Skip to content

Commit 2107533

Browse files
committed
Shared: Clippy fixes
Use clearer methods where appropriate.
1 parent 6a8d417 commit 2107533

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

shared/tree-sitter-extractor/src/diagnostics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,27 +255,27 @@ impl DiagnosticMessage {
255255
match args.get(i) {
256256
Some(MessageArg::Code(t)) => {
257257
plain.push_str(t);
258-
if t.len() > 0 {
258+
if !t.is_empty() {
259259
let count = longest_backtick_sequence_length(t) + 1;
260260
markdown.push_str(&"`".repeat(count));
261261
if count > 1 {
262-
markdown.push_str(" ");
262+
markdown.push(' ');
263263
}
264264
markdown.push_str(t);
265265
if count > 1 {
266-
markdown.push_str(" ");
266+
markdown.push(' ');
267267
}
268268
markdown.push_str(&"`".repeat(count));
269269
}
270270
}
271271
Some(MessageArg::Link(text, url)) => {
272272
plain.push_str(text);
273273
self.help_link(url);
274-
markdown.push_str("[");
274+
markdown.push('[');
275275
markdown.push_str(text);
276276
markdown.push_str("](");
277277
markdown.push_str(url);
278-
markdown.push_str(")");
278+
markdown.push(')');
279279
}
280280
None => {}
281281
}

shared/tree-sitter-extractor/src/trap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl fmt::Display for Entry {
9797
match self {
9898
Entry::FreshId(label) => write!(f, "{}=*", label),
9999
Entry::MapLabelToKey(label, key) => {
100-
write!(f, "{}=@\"{}\"", label, key.replace("\"", "\"\""))
100+
write!(f, "{}=@\"{}\"", label, key.replace('"', "\"\""))
101101
}
102102
Entry::GenericTuple(name, args) => {
103103
write!(f, "{}(", name)?;
@@ -142,7 +142,7 @@ impl fmt::Display for Arg {
142142
Arg::String(x) => write!(
143143
f,
144144
"\"{}\"",
145-
limit_string(x, MAX_STRLEN).replace("\"", "\"\"")
145+
limit_string(x, MAX_STRLEN).replace('"', "\"\"")
146146
),
147147
}
148148
}

0 commit comments

Comments
 (0)