MCPcopy Create free account
hub / github.com/archlinux/alpm / timestamp

Function timestamp

alpm-mtree/src/parser.rs:179–188  ·  view source on GitHub ↗

Parse a Unix timestamp. In mtree, this is a float for some reason, even though the decimal place is always a `0`.

(input: &mut &str)

Source from the content-addressed store, hash-verified

177///
178/// In mtree, this is a float for some reason, even though the decimal place is always a `0`.
179fn timestamp(input: &mut &str) -> ModalResult<i64> {
180 let (timestamp, _) = cut_err(separated_pair(digit1.parse_to(), '.', digit1))
181 .context(StrContext::Label("unix epoch"))
182 .context(StrContext::Expected(StrContextValue::Description(
183 "A unix epoch in float notation.",
184 )))
185 .parse_next(input)?;
186
187 Ok(timestamp)
188}
189
190/// Parse a filesystem mode.
191///

Callers 1

propertyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected