From: Ian Jackson Date: Wed, 12 May 2021 08:46:14 +0000 (+0100) Subject: bundles: Move i() method onto ZipArchive X-Git-Tag: otter-0.6.0~330 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4e84f0afa173fe85b0b51d426137308179573bad;p=otter.git bundles: Move i() method onto ZipArchive shapelib will want this. Signed-off-by: Ian Jackson --- diff --git a/src/bundles.rs b/src/bundles.rs index 3558f036..436865a0 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -73,7 +73,7 @@ display_as_debug!{LoadError} //---------- private definitions ---------- -type ZipArchive = zipfile::read::ZipArchive>; +pub type ZipArchive = zipfile::read::ZipArchive>; #[derive(Debug,Clone,Serialize,Deserialize)] struct Parsed { @@ -314,9 +314,12 @@ impl IndexedZip where { else return Ok(None) } Some(self.za.by_index(i)?) } +} +#[ext(pub)] +impl ZipArchive { #[throws(LoadError)] - pub fn i<'z>(&'z mut self, i: ZipIndex) -> ZipFile<'z> { + fn i<'z>(&'z mut self, i: ZipIndex) -> ZipFile<'z> { self.by_index(i.0)? } }