]> git.lizzy.rs Git - rust.git/blobdiff - src/libcollections/slice.rs
Deprecate the bytes!() macro.
[rust.git] / src / libcollections / slice.rs
index ff00ca58e8c7668b014105a3c0eaeb388bf37c36..f9826fcd2287ff8e37d39bc2a86a7c93b043a9ff 100644 (file)
@@ -1957,30 +1957,30 @@ fn test_shrink_to_fit() {
 
     #[test]
     fn test_starts_with() {
-        assert!(bytes!("foobar").starts_with(bytes!("foo")));
-        assert!(!bytes!("foobar").starts_with(bytes!("oob")));
-        assert!(!bytes!("foobar").starts_with(bytes!("bar")));
-        assert!(!bytes!("foo").starts_with(bytes!("foobar")));
-        assert!(!bytes!("bar").starts_with(bytes!("foobar")));
-        assert!(bytes!("foobar").starts_with(bytes!("foobar")));
+        assert!(b"foobar".starts_with(b"foo"));
+        assert!(!b"foobar".starts_with(b"oob"));
+        assert!(!b"foobar".starts_with(b"bar"));
+        assert!(!b"foo".starts_with(b"foobar"));
+        assert!(!b"bar".starts_with(b"foobar"));
+        assert!(b"foobar".starts_with(b"foobar"));
         let empty: &[u8] = [];
         assert!(empty.starts_with(empty));
-        assert!(!empty.starts_with(bytes!("foo")));
-        assert!(bytes!("foobar").starts_with(empty));
+        assert!(!empty.starts_with(b"foo"));
+        assert!(b"foobar".starts_with(empty));
     }
 
     #[test]
     fn test_ends_with() {
-        assert!(bytes!("foobar").ends_with(bytes!("bar")));
-        assert!(!bytes!("foobar").ends_with(bytes!("oba")));
-        assert!(!bytes!("foobar").ends_with(bytes!("foo")));
-        assert!(!bytes!("foo").ends_with(bytes!("foobar")));
-        assert!(!bytes!("bar").ends_with(bytes!("foobar")));
-        assert!(bytes!("foobar").ends_with(bytes!("foobar")));
+        assert!(b"foobar".ends_with(b"bar"));
+        assert!(!b"foobar".ends_with(b"oba"));
+        assert!(!b"foobar".ends_with(b"foo"));
+        assert!(!b"foo".ends_with(b"foobar"));
+        assert!(!b"bar".ends_with(b"foobar"));
+        assert!(b"foobar".ends_with(b"foobar"));
         let empty: &[u8] = [];
         assert!(empty.ends_with(empty));
-        assert!(!empty.ends_with(bytes!("foo")));
-        assert!(bytes!("foobar").ends_with(empty));
+        assert!(!empty.ends_with(b"foo"));
+        assert!(b"foobar".ends_with(empty));
     }
 
     #[test]