Skip to content

Commit

Permalink
Fix no_std build.
Browse files Browse the repository at this point in the history
  • Loading branch information
caibear committed Apr 29, 2024
1 parent 61453bc commit 14139fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub fn error(_msg: &'static str) -> Error {
/// Creates an error from a `T:` [`Display`].
#[cfg(feature = "serde")]
pub fn error_from_display(_t: impl Display) -> Error {
#[cfg(debug_assertions)]
use alloc::string::ToString;
#[cfg(debug_assertions)]
return Error(Cow::Owned(_t.to_string()));
#[cfg(not(debug_assertions))]
Expand Down

0 comments on commit 14139fc

Please sign in to comment.