docs(nix-compat/derivation/parser): explain why from_algo_and_mode_and_digest lives here

Change-Id: Id11026115a98703ac0e7d27fcb2286e5afe35f4c
Reviewed-on: https://cl.snix.dev/c/snix/+/30566
Reviewed-by: Yureka <snix@yuka.dev>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
This commit is contained in:
Florian Klink 2025-06-05 22:40:34 +03:00 committed by clbot
parent 859faa8eb1
commit 8502e487c4

View file

@ -79,7 +79,8 @@ pub fn parse_streaming(i: &[u8]) -> (Result<Derivation, Error<&[u8]>>, &[u8]) {
/// Consume a string containing the algo, and optionally a `r:`
/// prefix, and a digest (bytes), return a [CAHash::Nar] or [CAHash::Flat].
// TODO: This maybe should belong in ca_hash.rs
/// This does not live in CAHash, as its only possible to construct a subset of CAHash kinds,
/// and only used inside Derivation ATerm.
fn from_algo_and_mode_and_digest<B: AsRef<[u8]>>(
algo_and_mode: &str,
digest: B,