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

Function flag

atomic-core/src/change/format_v3/semantic/wire.rs:129–135  ·  view source on GitHub ↗
(input: &mut &[u8])

Source from the content-addressed store, hash-verified

127}
128
129pub(super) fn flag(input: &mut &[u8]) -> FormatResult<bool> {
130 match get(input)? {
131 0 => Ok(false),
132 1 => Ok(true),
133 _ => Err(invalid("invalid optional flag")),
134 }
135}
136
137pub(super) fn number(n: u64) -> FormatResult<usize> {
138 usize::try_from(n).map_err(|_| invalid("integer exceeds platform range"))

Callers 1

flagMethod · 0.70

Calls 2

getFunction · 0.70
invalidFunction · 0.70

Tested by

no test coverage detected