From: Ian Jackson Date: Wed, 12 May 2021 18:03:33 +0000 (+0100) Subject: bundles: Implement some more traits for ZipIndex X-Git-Tag: otter-0.6.0~328 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=0ee1dfdfbd1b4f5fb5c5c7ea47e6d77f34791e9b;p=otter.git bundles: Implement some more traits for ZipIndex Signed-off-by: Ian Jackson --- diff --git a/src/bundles.rs b/src/bundles.rs index 6f0f51e8..817b440f 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -281,7 +281,12 @@ pub struct IndexedZip { } deref_to_field_mut!{IndexedZip, ZipArchive, za } +#[derive(Debug,Copy,Clone,Hash,Eq,PartialEq,Ord,PartialOrd)] pub struct ZipIndex(pub usize); +impl Display for ZipIndex { + #[throws(fmt::Error)] + fn fmt(&self, f: &mut Formatter) { write!(f,"{}",self.0)? } +} impl IndexedZip where { #[throws(LoadError)]