]> git.lizzy.rs Git - rust.git/commitdiff
serialize: base64: remove some .as_bytes() from the tests
authorArcterus <Arcterus@mail.com>
Tue, 9 Dec 2014 08:21:43 +0000 (00:21 -0800)
committerArcterus <Arcterus@mail.com>
Tue, 9 Dec 2014 15:40:21 +0000 (07:40 -0800)
src/libserialize/base64.rs

index 17bb3dadaebc814429586cd512abd7db318290a2..59faf75c0c30cffccb66c2828135d539fee4e506 100644 (file)
@@ -320,8 +320,8 @@ fn test_to_base64_basic() {
     fn test_to_base64_crlf_line_break() {
         assert!(![0u8, ..1000].to_base64(Config {line_length: None, ..STANDARD})
                               .contains("\r\n"));
-        assert_eq!("foobar".as_bytes().to_base64(Config {line_length: Some(4),
-                                                         ..STANDARD}),
+        assert_eq!(b"foobar".to_base64(Config {line_length: Some(4),
+                                               ..STANDARD}),
                    "Zm9v\r\nYmFy");
     }
 
@@ -332,10 +332,10 @@ fn test_to_base64_lf_line_break() {
                                                  ..STANDARD})
                               .as_slice()
                               .contains("\n"));
-        assert_eq!("foobar".as_bytes().to_base64(Config {line_length: Some(4),
-                                                         newline: Newline::LF,
-                                                         ..STANDARD}),
-                   "Zm9v\nYmFy".to_string());
+        assert_eq!(b"foobar".to_base64(Config {line_length: Some(4),
+                                               newline: Newline::LF,
+                                               ..STANDARD}),
+                   "Zm9v\nYmFy");
     }
 
     #[test]