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

Function parse_finding

atomic-core/src/kg/iri.rs:250–257  ·  view source on GitHub ↗
(iri: &str)

Source from the content-addressed store, hash-verified

248 )
249}
250pub fn parse_finding(iri: &str) -> Result<(ProjectId, String, Hash), IriError> {
251 let (project, rest) = parse_qualified(iri, "finding")?;
252 let (code, hash) = rest.split_once(':').ok_or_else(|| IriError(iri.into()))?;
253 let hash = strict_base32(hash)
254 .map(crate::types::Merkle)
255 .map_err(|_| IriError(iri.into()))?;
256 Ok((project, decode(code, false)?, hash))
257}

Callers

nothing calls this directly

Calls 4

parse_qualifiedFunction · 0.85
IriErrorClass · 0.85
strict_base32Function · 0.85
decodeFunction · 0.70

Tested by

no test coverage detected