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

Function validate_presence

atomic-core/src/pristine/file_index_v2.rs:344–356  ·  view source on GitHub ↗
(
    fields: FileIndexV2Fields,
    field: FileIndexV2Fields,
    present: bool,
    name: &str,
)

Source from the content-addressed store, hash-verified

342}
343
344fn validate_presence(
345 fields: FileIndexV2Fields,
346 field: FileIndexV2Fields,
347 present: bool,
348 name: &str,
349) -> PristineResult<()> {
350 if fields.contains(field) != present {
351 return Err(codec_error(format!(
352 "FILE_INDEX_V2 {name} presence flag disagrees with value"
353 )));
354 }
355 Ok(())
356}
357
358fn put_u64(dst: &mut [u8], value: Option<u64>) {
359 if let Some(value) = value {

Callers 1

validate_entryFunction · 0.85

Calls 2

codec_errorFunction · 0.70
containsMethod · 0.45

Tested by

no test coverage detected