From eede24b13c800edc80496dcf3ce36276b6e9d64b Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Fri, 16 Oct 2020 15:35:40 +0100 Subject: [PATCH] String can be compared to &str --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 427c2fc..c79ea4a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -194,7 +194,7 @@ mod test { #[test] fn test_optional_data_line() { let output = optional_data_line("NAME", mock::item().name); - assert_eq!(output, "\nNAME door".to_string()); + assert_eq!(output, "\nNAME door"); } #[test] @@ -216,14 +216,14 @@ mod test { #[test] fn quote() { let output = "this is a string.\nIt has 2 lines".to_string().quote(); - let expected = "\"\"\"\nthis is a string.\nIt has 2 lines\n\"\"\"".to_string(); + let expected = "\"\"\"\nthis is a string.\nIt has 2 lines\n\"\"\""; assert_eq!(output, expected); } #[test] fn unquote() { let output = "\"\"\"\nwho the fuck is scraeming \"LOG OFF\" at my house.\nshow yourself, coward.\ni will never log off\n\"\"\"".to_string().unquote(); - let expected = "who the fuck is scraeming \"LOG OFF\" at my house.\nshow yourself, coward.\ni will never log off".to_string(); + let expected = "who the fuck is scraeming \"LOG OFF\" at my house.\nshow yourself, coward.\ni will never log off"; assert_eq!(output, expected); } @@ -232,12 +232,12 @@ mod test { // does a conflict generate a new ID? assert_eq!( try_id(&vec!["0".to_string(), "1".to_string()], &"1".to_string()), - "2".to_string() + "2" ); // with no conflict, does the ID remain the same? assert_eq!( try_id(&vec!["0".to_string(), "1".to_string()], &"3".to_string()), - "3".to_string() + "3" ); }