about summary refs log tree commit diff
path: root/src/libstd/error.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-10 16:05:09 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-10 16:07:46 -0700
commitf329030b095aa30ce29be0c3459615d85506747b (patch)
tree5b6274f806573e059f79bd3c4aa67633cb30f8a9 /src/libstd/error.rs
parentc897ac04e2ebda378fd9e38f6ec0878ae3a2baf7 (diff)
downloadrust-f329030b095aa30ce29be0c3459615d85506747b.tar.gz
rust-f329030b095aa30ce29be0c3459615d85506747b.zip
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.
Diffstat (limited to 'src/libstd/error.rs')
-rw-r--r--src/libstd/error.rs5
1 files changed, 1 insertions, 4 deletions
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"
     }
 }