mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
rollup merge of #24310: alexcrichton/stabilize-utf8-error
The meaning of each variant of this enum was somewhat ambiguous and it's uncler that we wouldn't even want to add more enumeration values in the future. As a result this error has been altered to instead become an opaque structure. Learning about the "first invalid byte index" is still an unstable feature, but the type itself is now stable.
This commit is contained in:
+1
-4
@@ -122,10 +122,7 @@ fn description(&self) -> &str { "failed to parse bool" }
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Error for str::Utf8Error {
|
||||
fn description(&self) -> &str {
|
||||
match *self {
|
||||
str::Utf8Error::TooShort => "invalid utf-8: not enough bytes",
|
||||
str::Utf8Error::InvalidByte(..) => "invalid utf-8: corrupt contents",
|
||||
}
|
||||
"invalid utf-8: corrupt contents"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user