craft-doc: keep helpers before the test module

This commit is contained in:
dotCooCoo committed 2026-11-03 06:17:53 -08:00
1 parent 5f3aed6309
commit c395cdc092
1 file changed
+8 -8
+8 -8
View File
@@ -218,6 +218,14 @@ fn document_outline(d: DocM, budget: &Budget) -> Result<Outline, Error> {
})
}
/// The archive and the manifest's document read as `D`, checked as [`outline`] reads it.
#[cfg(feature = "pcraft-pixels")]
pub(crate) fn document<'a, D: DeserializeOwned>(bytes: &'a [u8], budget: &mut Budget) -> Result<(Zip<'a>, D), Error> {
let (zip, json) = manifest(bytes, budget)?;
let document = read::<D>(&json, budget)?.document;
Ok((zip, document))
}
#[cfg(test)]
mod cancellation_tests {
#![allow(clippy::unwrap_used)]
@@ -241,11 +249,3 @@ mod cancellation_tests {
assert_eq!(polls.get(), 4);
}
}
/// The archive and the manifest's document read as `D`, checked as [`outline`] reads it.
#[cfg(feature = "pcraft-pixels")]
pub(crate) fn document<'a, D: DeserializeOwned>(bytes: &'a [u8], budget: &mut Budget) -> Result<(Zip<'a>, D), Error> {
let (zip, json) = manifest(bytes, budget)?;
let document = read::<D>(&json, budget)?.document;
Ok((zip, document))
}