From f329030b095aa30ce29be0c3459615d85506747b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 10 Apr 2015 16:05:09 -0700 Subject: std: Stabilize the Utf8Error type 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. --- src/libstd/error.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/error.rs b/src/libstd/error.rs index c9babeb3230..96087bf1183 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -122,10 +122,7 @@ impl Error for str::ParseBoolError { #[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" } } -- cgit 1.4.1-3-g733a5