From: Ian Jackson Date: Mon, 3 May 2021 22:53:14 +0000 (+0100) Subject: bundles: Rename NotBundle from NotBundleError X-Git-Tag: otter-0.6.0~412 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7dc872256a9e6e6fcf4e3b8d0b3441befe6d6ba0;p=otter.git bundles: Rename NotBundle from NotBundleError Signed-off-by: Ian Jackson --- diff --git a/src/bundles.rs b/src/bundles.rs index 4a1d3b33..2abd5eda 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -133,16 +133,16 @@ impl Id { #[derive(Debug,Copy,Clone,Error)] #[error("{0}")] #[repr(transparent)] -pub struct NotBundleError(&'static str); -impl From<&'static str> for NotBundleError { - fn from(s: &'static str) -> NotBundleError { +pub struct NotBundle(&'static str); +impl From<&'static str> for NotBundle { + fn from(s: &'static str) -> NotBundle { unsafe { mem::transmute(s) } } } #[derive(Error,Debug)] enum IncorporateError { - #[error("NotBundle({0})")] NotBundle(#[from] NotBundleError), + #[error("NotBundle({0})")] NotBundle(#[from] NotBundle), #[error("{0}")] IE(#[from] IE), } @@ -194,8 +194,8 @@ fn load_bundle(ib: &mut InstanceBundles, ig: &mut Instance, } impl FromStr for Id { - type Err = NotBundleError; - #[throws(NotBundleError)] + type Err = NotBundle; + #[throws(NotBundle)] fn from_str(fleaf: &str) -> Id { let [lhs, rhs] = fleaf.splitn(2, '.') .collect::>()