chiark / gitweb /
bundles: Move i() method onto ZipArchive
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 12 May 2021 08:46:14 +0000 (09:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 12 May 2021 08:46:14 +0000 (09:46 +0100)
shapelib will want this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bundles.rs

index 3558f036421756298b4ff98fc432d3f029ed0a6c..436865a08f3a381c7c23a8fd80666398216fe712 100644 (file)
@@ -73,7 +73,7 @@ display_as_debug!{LoadError}
 
 //---------- private definitions ----------
 
-type ZipArchive = zipfile::read::ZipArchive<BufReader<File>>;
+pub type ZipArchive = zipfile::read::ZipArchive<BufReader<File>>;
 
 #[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)?
   }
 }