From 9d684c40a91cb5691b51cf1a04503c0ae27240ed Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 4 Jul 2020 03:03:49 +0100 Subject: [PATCH] OE --- src/error.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) } -- 2.30.2