From 4e84f0afa173fe85b0b51d426137308179573bad Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 12 May 2021 09:46:14 +0100 Subject: [PATCH] bundles: Move i() method onto ZipArchive shapelib will want this. Signed-off-by: Ian Jackson --- src/bundles.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)? } } -- 2.30.2