diff options
author | Narawit Rakket <narawitrakket@hotmail.com> | 2022-07-10 16:54:39 +0700 |
---|---|---|
committer | Abin Simon <abinsimon10@gmail.com> | 2022-07-10 16:05:39 +0530 |
commit | 2600644d6a923504b6485c56f575134edf49361b (patch) | |
tree | be89ae59c7400d578397919a1c5dffc7157ac7b5 | |
parent | b247650d37deb89d097a279f600ffc6704efb77d (diff) |
refactor(test): remove unnecessary reference
-rw-r--r-- | src/display.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/display.rs b/src/display.rs index fea7b7d..472bf26 100644 --- a/src/display.rs +++ b/src/display.rs @@ -418,7 +418,7 @@ mod tests { #[test] fn test_display_get_visible_width_without_icons() { - for (s, l) in &[ + for (s, l) in [ ("Hello,world!", 22), ("ASCII1234-_", 11), ("制作样本。", 10), @@ -444,13 +444,13 @@ mod tests { ) .to_string(); - assert_eq!(get_visible_width(&output, false), *l); + assert_eq!(get_visible_width(&output, false), l); } } #[test] fn test_display_get_visible_width_with_icons() { - for (s, l) in &[ + for (s, l) in [ // Add 3 characters for the icons. ("Hello,world!", 24), ("ASCII1234-_", 13), @@ -478,13 +478,13 @@ mod tests { ) .to_string(); - assert_eq!(get_visible_width(&output, false), *l); + assert_eq!(get_visible_width(&output, false), l); } } #[test] fn test_display_get_visible_width_with_colors() { - for (s, l) in &[ + for (s, l) in [ ("Hello,world!", 22), ("ASCII1234-_", 11), ("File with space", 15), @@ -519,13 +519,13 @@ mod tests { ); assert!(output.ends_with("[39m"), "reset foreground color"); - assert_eq!(get_visible_width(&output, false), *l, "visible match"); + assert_eq!(get_visible_width(&output, false), l, "visible match"); } } #[test] fn test_display_get_visible_width_without_colors() { - for (s, l) in &[ + for (s, l) in [ ("Hello,world!", 22), ("ASCII1234-_", 11), ("File with space", 15), @@ -556,13 +556,13 @@ mod tests { assert!(!output.starts_with("\u{1b}[38;5;")); assert!(!output.ends_with("[0m")); - assert_eq!(get_visible_width(&output, false), *l); + assert_eq!(get_visible_width(&output, false), l); } } #[test] fn test_display_get_visible_width_hypelink_simple() { - for (s, l) in &[ + for (s, l) in [ ("Hello,world!", 22), ("ASCII1234-_", 11), ("File with space", 15), @@ -574,7 +574,7 @@ mod tests { ] { // rending name require actual file, so we are mocking that let output = format!("\x1B]8;;{}\x1B\x5C{}\x1B]8;;\x1B\x5C", "url://fake-url", s); - assert_eq!(get_visible_width(&output, true), *l); + assert_eq!(get_visible_width(&output, true), l); } } |