mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-11 13:02:25 +00:00
craft-doc: keep helpers before the test module
This commit is contained in:
1 parent
5f3aed6309
commit
c395cdc092
1 file changed
+8
-8
@@ -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))
|
||||
}
|
||||
Reference in new issue
Block a user