MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / read_hash

Function read_hash

atomic-core/src/pristine/file_index_v2.rs:403–407  ·  view source on GitHub ↗
(src: &[u8], fields: FileIndexV2Fields, field: FileIndexV2Fields)

Source from the content-addressed store, hash-verified

401 .map(Some)
402}
403fn read_hash(src: &[u8], fields: FileIndexV2Fields, field: FileIndexV2Fields) -> Option<Hash> {
404 fields
405 .contains(field)
406 .then(|| Hash::from(<[u8; 32]>::try_from(src).unwrap()))
407}
408fn codec_error(message: impl Into<String>) -> PristineError {
409 PristineError::Serialization {
410 message: message.into(),

Callers 1

decode_file_index_v2Function · 0.85

Calls 2

containsMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected