Skip to content

Commit 474d4d5

Browse files
committed
remove unnecessary coercion of '&str' to 'String'
1 parent f7576a9 commit 474d4d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,19 @@ pub fn escape_brackets(s: &str) -> String {
165165
if acc == "" {
166166
x.to_string()
167167
} else if acc.ends_with('\\') {
168-
acc + "[" + &x.to_string()
168+
acc + "[" + x
169169
} else {
170-
acc + "\\[" + &x.to_string()
170+
acc + "\\[" + x
171171
}
172172
})
173173
.split(']')
174174
.fold("".to_string(), |acc, x| {
175175
if acc == "" {
176176
x.to_string()
177177
} else if acc.ends_with('\\') {
178-
acc + "]" + &x.to_string()
178+
acc + "]" + x
179179
} else {
180-
acc + "\\]" + &x.to_string()
180+
acc + "\\]" + x
181181
}
182182
})
183183
}

0 commit comments

Comments
 (0)