From: Ian Jackson Date: Tue, 11 May 2021 23:46:44 +0000 (+0100) Subject: bundles: Try to slightly reduce amount of Zip monomorphisation X-Git-Tag: otter-0.6.0~339 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=85467d8fa618b976714255b01cd52d2f25fe61c0;p=otter.git bundles: Try to slightly reduce amount of Zip monomorphisation Signed-off-by: Ian Jackson --- diff --git a/src/bundles.rs b/src/bundles.rs index efdbecc2..d54dfc5a 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -254,6 +254,9 @@ impl MgmtBundleList { //---------- loading ---------- +trait ReadSeek: Read + io::Seek { } +impl ReadSeek for T where T: Read + io::Seek { } + impl From for LoadError { fn from(ze: ZipError) -> LoadError { match ze { @@ -404,9 +407,8 @@ impl BundleParseErrorHandling for BundleParseUpload { } #[throws(EH::Err)] -fn parse_bundle(id: Id, file: &mut F, eh: EH) -> Parsed -where EH: BundleParseErrorHandling, - F: Read + io::Seek +fn parse_bundle(id: Id, file: &mut dyn ReadSeek, eh: EH) -> Parsed + where EH: BundleParseErrorHandling, { match id.kind { Kind::Zip => () } let mut za = eh.required(||{