diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-13 08:18:49 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-13 08:18:49 +0100 |
commit | adbee621a75f47e0da4f30d7205dfce009138865 (patch) | |
tree | ed8dcbba37de566f00d119817e141bb8293ce164 /crates/syntax/src/ast | |
parent | f107b0f1e223dba33cb9850ce44bcbb4345eef52 (diff) | |
parent | 5ac6804bb3a07b959e8c2c3534255a8d6bb4948c (diff) |
Merge #9242
9242: Clippy r=matklad a=Maan2003
Best viewed commit wise
Co-authored-by: Maan2003 <[email protected]>
Diffstat (limited to 'crates/syntax/src/ast')
-rw-r--r-- | crates/syntax/src/ast/edit.rs | 4 | ||||
-rw-r--r-- | crates/syntax/src/ast/token_ext.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs index 19107ee38..2663c0759 100644 --- a/crates/syntax/src/ast/edit.rs +++ b/crates/syntax/src/ast/edit.rs | |||
@@ -30,7 +30,7 @@ impl ast::UseTree { | |||
30 | let suffix = if self.path().as_ref() == Some(prefix) && self.use_tree_list().is_none() { | 30 | let suffix = if self.path().as_ref() == Some(prefix) && self.use_tree_list().is_none() { |
31 | make::path_unqualified(make::path_segment_self()) | 31 | make::path_unqualified(make::path_segment_self()) |
32 | } else { | 32 | } else { |
33 | match split_path_prefix(&prefix) { | 33 | match split_path_prefix(prefix) { |
34 | Some(it) => it, | 34 | Some(it) => it, |
35 | None => return self.clone(), | 35 | None => return self.clone(), |
36 | } | 36 | } |
@@ -95,7 +95,7 @@ impl fmt::Display for IndentLevel { | |||
95 | let indent = if len <= spaces.len() { | 95 | let indent = if len <= spaces.len() { |
96 | &spaces[..len] | 96 | &spaces[..len] |
97 | } else { | 97 | } else { |
98 | buf = iter::repeat(' ').take(len).collect::<String>(); | 98 | buf = " ".repeat(len); |
99 | &buf | 99 | &buf |
100 | }; | 100 | }; |
101 | fmt::Display::fmt(indent, f) | 101 | fmt::Display::fmt(indent, f) |
diff --git a/crates/syntax/src/ast/token_ext.rs b/crates/syntax/src/ast/token_ext.rs index 4b1e1ccee..ad52d9f54 100644 --- a/crates/syntax/src/ast/token_ext.rs +++ b/crates/syntax/src/ast/token_ext.rs | |||
@@ -242,7 +242,7 @@ impl ast::ByteString { | |||
242 | (Ok(c), true) if char_range.len() == 1 && Some(c) == text_iter.next() => (), | 242 | (Ok(c), true) if char_range.len() == 1 && Some(c) == text_iter.next() => (), |
243 | (Ok(c), true) => { | 243 | (Ok(c), true) => { |
244 | buf.reserve_exact(text.len()); | 244 | buf.reserve_exact(text.len()); |
245 | buf.extend_from_slice(&text[..char_range.start].as_bytes()); | 245 | buf.extend_from_slice(text[..char_range.start].as_bytes()); |
246 | buf.push(c as u8); | 246 | buf.push(c as u8); |
247 | } | 247 | } |
248 | (Err(_), _) => has_error = true, | 248 | (Err(_), _) => has_error = true, |