diff options
Diffstat (limited to 'src/libcollectionstest')
| -rw-r--r-- | src/libcollectionstest/fmt.rs | 2 | ||||
| -rw-r--r-- | src/libcollectionstest/slice.rs | 2 | ||||
| -rw-r--r-- | src/libcollectionstest/str.rs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/libcollectionstest/fmt.rs b/src/libcollectionstest/fmt.rs index 9a9aa71b58b..abd1262dbf1 100644 --- a/src/libcollectionstest/fmt.rs +++ b/src/libcollectionstest/fmt.rs @@ -13,5 +13,5 @@ use std::fmt; #[test] fn test_format() { let s = fmt::format(format_args!("Hello, {}!", "world")); - assert_eq!(s.as_slice(), "Hello, world!"); + assert_eq!(&s[..], "Hello, world!"); } diff --git a/src/libcollectionstest/slice.rs b/src/libcollectionstest/slice.rs index 4168fe88a4b..24cafa9f1c6 100644 --- a/src/libcollectionstest/slice.rs +++ b/src/libcollectionstest/slice.rs @@ -59,7 +59,7 @@ fn test_from_elem() { // Test on-heap from_elem. v = vec![20; 6]; { - let v = v.as_slice(); + let v = &v[..]; assert_eq!(v[0], 20); assert_eq!(v[1], 20); assert_eq!(v[2], 20); diff --git a/src/libcollectionstest/str.rs b/src/libcollectionstest/str.rs index 5cfa8009054..5b390befebe 100644 --- a/src/libcollectionstest/str.rs +++ b/src/libcollectionstest/str.rs @@ -1470,9 +1470,9 @@ fn test_split_strator() { fn test_str_default() { use std::default::Default; - fn t<S: Default + Str>() { + fn t<S: Default + AsRef<str>>() { let s: S = Default::default(); - assert_eq!(s.as_slice(), ""); + assert_eq!(s.as_ref(), ""); } t::<&str>(); |
