.. which unfortunately requires std until error_in_core (rust-lang/rust#103765) is stabilized, so the std feature is no longer a no-op. If that means you'd prefer to wait for error_in_core, that's fine with me.
The net result here is that TryFromIntError plays nice with crates such as anyhow, and the following compiles:
#[cfg(feature = "std")]
mod test_anyhow {
use anyhow::Result;
use super::*;
fn testing_anyhow() -> Result<u6> {
Ok(u6::try_from(u63::new(63))?)
}
}
To me this seems like it'd be nice, and given that there's already an std feature it seems reasonable to just use it as a gate for this. Will give a bit longer to see if anyone else has any thoughts.
.. which unfortunately requires
std
untilerror_in_core
(rust-lang/rust#103765) is stabilized, so thestd
feature is no longer a no-op. If that means you'd prefer to wait forerror_in_core
, that's fine with me.The net result here is that
TryFromIntError
plays nice with crates such asanyhow
, and the following compiles:The error description is copied verbatim from its
std::num
counterpart: https://doc.rust-lang.org/src/core/num/error.rs.html#24