Skip to content

Commit aa8c458

Browse files
authored
style: include inefficient_to_string (#760)
1 parent 218c4a8 commit aa8c458

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ from_iter_instead_of_collect = { level = "allow", priority = 1 }
4343
if_not_else = { level = "allow", priority = 1 }
4444
implicit_clone = { level = "allow", priority = 1 }
4545
implicit_hasher = { level = "allow", priority = 1 }
46-
inefficient_to_string = { level = "allow", priority = 1 }
4746
items_after_statements = { level = "allow", priority = 1 }
4847
iter_without_into_iter = { level = "allow", priority = 1 }
4948
linkedlist = { level = "allow", priority = 1 }

src/ciphers/morse_code.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn encode(message: &str) -> String {
1010
.chars()
1111
.map(|char| char.to_uppercase().to_string())
1212
.map(|letter| dictionary.get(letter.as_str()))
13-
.map(|option| option.unwrap_or(&UNKNOWN_CHARACTER).to_string())
13+
.map(|option| (*option.unwrap_or(&UNKNOWN_CHARACTER)).to_string())
1414
.collect::<Vec<String>>()
1515
.join(" ")
1616
}
@@ -89,10 +89,10 @@ fn _check_all_parts(string: &str) -> bool {
8989
}
9090

9191
fn _decode_token(string: &str) -> String {
92-
_morse_to_alphanumeric_dictionary()
92+
(*_morse_to_alphanumeric_dictionary()
9393
.get(string)
94-
.unwrap_or(&_UNKNOWN_MORSE_CHARACTER)
95-
.to_string()
94+
.unwrap_or(&_UNKNOWN_MORSE_CHARACTER))
95+
.to_string()
9696
}
9797

9898
fn _decode_part(string: &str) -> String {

0 commit comments

Comments
 (0)