From: Ian Jackson Date: Sat, 4 Jul 2020 02:03:49 +0000 (+0100) Subject: OE X-Git-Tag: otter-0.2.0~1478 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9d684c40a91cb5691b51cf1a04503c0ae27240ed;p=otter.git OE --- diff --git a/src/error.rs b/src/error.rs index 2fe93f32..75c8b9ff 100644 --- a/src/error.rs +++ b/src/error.rs @@ -25,15 +25,17 @@ impl From> for OnlineError { pub trait ById { type Id; type Entry; - #[throws(OE)] + type Error; + #[throws(Self::Error)] fn byid(&self, t: Self::Id) -> &Self::Entry; - #[throws(OE)] + #[throws(Self::Error)] fn byid_mut(&mut self, t: Self::Id) -> &mut Self::Entry; } impl ById for DenseSlotMap { type Id = I; type Entry = T; + type Error = OE; fn byid(&self, t: Self::Id) -> Result<&Self::Entry, OE> { self.get(t).ok_or(::ERROR) } @@ -44,6 +46,7 @@ impl ById for DenseSlotMap { impl ById for SecondarySlotMap { type Id = I; type Entry = T; + type Error = OE; fn byid(&self, t: Self::Id) -> Result<&Self::Entry, OE> { self.get(t).ok_or(::ERROR) }