Skip to content

Commit 02acf2d

Browse files
committed
Obey clippy::inefficient_to_string
1 parent 5d5c524 commit 02acf2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tyrga-lib/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#![deny(bare_trait_objects)]
1616
#![deny(unused_mut)]
1717
#![deny(unused_variables)]
18+
#![deny(clippy::inefficient_to_string)]
1819

1920
// make macros visible to later modules
2021
#[macro_use]
@@ -1171,7 +1172,8 @@ mod util {
11711172
}
11721173

11731174
impl Manglable for &str {
1174-
fn pieces(&self) -> Vec<String> { vec![ self.to_string() ] }
1175+
// Dereference self explicitly to get faster ToString implementation
1176+
fn pieces(&self) -> Vec<String> { vec![ (*self).to_string() ] }
11751177
}
11761178

11771179
impl Manglable for String {

0 commit comments

Comments
 (0)