Implement TryFrom<char> for u8
Previously suggested in https://github.com/rust-lang/rfcs/issues/2854. It makes sense to have this since `char` implements `From<u8>`. Likewise `u32`, `u64`, and `u128` (since #79502) implement `From<char>`.
This commit is contained in:
committed by
Ian Douglas Scott
parent
e012a191d7
commit
a02639dc09
@@ -478,6 +478,9 @@ impl Error for char::DecodeUtf16Error {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "u8_from_char", since = "1.59.0")]
|
||||
impl Error for char::TryFromCharError {}
|
||||
|
||||
#[unstable(feature = "map_try_insert", issue = "82766")]
|
||||
impl<'a, K: Debug + Ord, V: Debug> Error
|
||||
for crate::collections::btree_map::OccupiedError<'a, K, V>
|
||||
|
||||
Reference in New Issue
Block a user