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-14 10:55:41 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-14 10:55:41 -0700
commit34603b0c19f134f446dc3180a02212b7839f316a (patch)
treeb5455b3f215a58c4c8bda114cec79a5b44e26949 /src/libstd/error.rs
parent88a145ea36967f8afb920af4e096113271432fc5 (diff)
parentf329030b095aa30ce29be0c3459615d85506747b (diff)
downloadrust-34603b0c19f134f446dc3180a02212b7839f316a.tar.gz
rust-34603b0c19f134f446dc3180a02212b7839f316a.zip
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.
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"
     }
 }