diff options
author | Matthias Krüger <[email protected]> | 2021-03-21 11:38:21 +0000 |
---|---|---|
committer | Matthias Krüger <[email protected]> | 2021-03-21 11:38:21 +0000 |
commit | 8a671168576b9b552a22be285646fc293a80d8c2 (patch) | |
tree | 4c2a4f07acfc73de24e9ab1ce16ce7b556c6b6d4 /xtask/src/codegen/gen_assists_docs.rs | |
parent | 3d9b3a8575ef3cb557fd847b941000df3b2db670 (diff) |
use strip_prefix() instead of starts_with and slicing (clippy::manual_strip)
Diffstat (limited to 'xtask/src/codegen/gen_assists_docs.rs')
-rw-r--r-- | xtask/src/codegen/gen_assists_docs.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs index 158680993..c91716409 100644 --- a/xtask/src/codegen/gen_assists_docs.rs +++ b/xtask/src/codegen/gen_assists_docs.rs | |||
@@ -154,8 +154,8 @@ fn hide_hash_comments(text: &str) -> String { | |||
154 | fn reveal_hash_comments(text: &str) -> String { | 154 | fn reveal_hash_comments(text: &str) -> String { |
155 | text.split('\n') // want final newline | 155 | text.split('\n') // want final newline |
156 | .map(|it| { | 156 | .map(|it| { |
157 | if it.starts_with("# ") { | 157 | if let Some(stripped) = it.strip_prefix("# ") { |
158 | &it[2..] | 158 | stripped |
159 | } else if it == "#" { | 159 | } else if it == "#" { |
160 | "" | 160 | "" |
161 | } else { | 161 | } else { |