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

Function ensure_strictly_sorted

atomic-core/src/operation/mod.rs:938–945  ·  view source on GitHub ↗
(values: &[T], field: &str)

Source from the content-addressed store, hash-verified

936}
937
938fn ensure_strictly_sorted<T: Ord>(values: &[T], field: &str) -> Result<(), OperationCodecError> {
939 if values.windows(2).any(|pair| pair[0] >= pair[1]) {
940 return Err(OperationCodecError::new(format!(
941 "{field} must be strictly sorted and unique"
942 )));
943 }
944 Ok(())
945}
946
947fn ensure_git_ref_observations_sorted(
948 values: &[GitRefObservation],

Callers 5

from_canonicalMethod · 0.85
validate_canonicalMethod · 0.85
encode_operation_headsFunction · 0.85
put_loss_noteMethod · 0.85
read_loss_noteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected