Skip to content

Commit a47be82

Browse files
committed
clippy::inefficient_to_string fix
`&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
1 parent a070608 commit a47be82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/security/cors.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ impl From<Vec<String>> for Origin {
236236

237237
impl From<Vec<&str>> for Origin {
238238
fn from(list: Vec<&str>) -> Self {
239-
Origin::from(list.iter().map(|s| s.to_string()).collect::<Vec<String>>())
239+
Origin::from(
240+
list.iter()
241+
.map(|s| (*s).to_string())
242+
.collect::<Vec<String>>(),
243+
)
240244
}
241245
}
242246

0 commit comments

Comments
 (0)