diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-14 10:55:41 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-14 10:55:41 -0700 |
| commit | 34603b0c19f134f446dc3180a02212b7839f316a (patch) | |
| tree | b5455b3f215a58c4c8bda114cec79a5b44e26949 /src/libcollectionstest | |
| parent | 88a145ea36967f8afb920af4e096113271432fc5 (diff) | |
| parent | f329030b095aa30ce29be0c3459615d85506747b (diff) | |
| download | rust-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/libcollectionstest')
| -rw-r--r-- | src/libcollectionstest/str.rs | 2 | ||||
| -rw-r--r-- | src/libcollectionstest/string.rs | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/libcollectionstest/str.rs b/src/libcollectionstest/str.rs index 15f15900e78..cacafab4e3c 100644 --- a/src/libcollectionstest/str.rs +++ b/src/libcollectionstest/str.rs @@ -1502,7 +1502,7 @@ fn test_str_from_utf8() { assert_eq!(from_utf8(xs), Ok("ศไทย中华Việt Nam")); let xs = b"hello\xFF"; - assert_eq!(from_utf8(xs), Err(Utf8Error::TooShort)); + assert!(from_utf8(xs).is_err()); } #[test] diff --git a/src/libcollectionstest/string.rs b/src/libcollectionstest/string.rs index 5d6aa8ac0dc..3184f842e9a 100644 --- a/src/libcollectionstest/string.rs +++ b/src/libcollectionstest/string.rs @@ -45,7 +45,6 @@ fn test_from_utf8() { let xs = b"hello\xFF".to_vec(); let err = String::from_utf8(xs).err().unwrap(); - assert_eq!(err.utf8_error(), Utf8Error::TooShort); assert_eq!(err.into_bytes(), b"hello\xff".to_vec()); } |
