diff --git a/all-is-cubes-base/src/util.rs b/all-is-cubes-base/src/util.rs index 724e4237a..37e500757 100644 --- a/all-is-cubes-base/src/util.rs +++ b/all-is-cubes-base/src/util.rs @@ -145,17 +145,36 @@ cfg_if::cfg_if! { } else { use alloc::boxed::Box; + use alloc::string::String; /// Substitute for [`std::error::Error`] with the same supertraits but no methods. /// #[doc(hidden)] pub trait ErrorIfStd: fmt::Debug + fmt::Display {} - impl ErrorIfStd for T where T: fmt::Debug + fmt::Display {} + impl ErrorIfStd for T where T: fmt::Debug + fmt::Display {} impl From<&str> for Box { #[allow(clippy::missing_inline_in_public_items)] fn from(s: &str) -> Self { - Box::new(alloc::string::String::from(s)) + Box::new(String::from(s)) + } + } + impl From<&str> for Box { + #[allow(clippy::missing_inline_in_public_items)] + fn from(s: &str) -> Self { + Box::new(String::from(s)) + } + } + impl From for Box { + #[allow(clippy::missing_inline_in_public_items)] + fn from(s: String) -> Self { + Box::new(s) + } + } + impl From for Box { + #[allow(clippy::missing_inline_in_public_items)] + fn from(s: String) -> Self { + Box::new(s) } }