1
Fork 0

clippy::single_char_pattern

This commit is contained in:
Matthias Krüger 2021-07-17 23:35:57 +02:00
parent dc722bfd74
commit d709e6efef
4 changed files with 5 additions and 5 deletions

View file

@ -365,7 +365,7 @@ pub fn llvm_global_features(sess: &Session) -> Vec<String> {
features_string features_string
}; };
features.extend(features_string.split(",").map(String::from)); features.extend(features_string.split(',').map(String::from));
} }
Some(_) | None => {} Some(_) | None => {}
}; };
@ -374,7 +374,7 @@ pub fn llvm_global_features(sess: &Session) -> Vec<String> {
if s.is_empty() { if s.is_empty() {
return None; return None;
} }
let feature = if s.starts_with("+") || s.starts_with("-") { let feature = if s.starts_with('+') || s.starts_with('-') {
&s[1..] &s[1..]
} else { } else {
return Some(s.to_string()); return Some(s.to_string());

View file

@ -834,7 +834,7 @@ fn ident_name_compatibility_hack(
.flat_map(|c| c.as_os_str().to_str()) .flat_map(|c| c.as_os_str().to_str())
.find(|c| c.starts_with("js-sys")) .find(|c| c.starts_with("js-sys"))
{ {
let mut version = c.trim_start_matches("js-sys-").split("."); let mut version = c.trim_start_matches("js-sys-").split('.');
if version.next() == Some("0") if version.next() == Some("0")
&& version.next() == Some("3") && version.next() == Some("3")
&& version && version

View file

@ -1876,7 +1876,7 @@ fn parse_extern_dep_specs(
) )
}); });
let locparts: Vec<_> = loc.split(":").collect(); let locparts: Vec<_> = loc.split(':').collect();
let spec = match &locparts[..] { let spec = match &locparts[..] {
["raw", ..] => { ["raw", ..] => {
// Don't want `:` split string // Don't want `:` split string

View file

@ -684,7 +684,7 @@ mod parse {
Some(v) => v, Some(v) => v,
}; };
*slot = Some(match v.trim_end_matches("s") { *slot = Some(match v.trim_end_matches('s') {
"statement" | "stmt" => MirSpanview::Statement, "statement" | "stmt" => MirSpanview::Statement,
"terminator" | "term" => MirSpanview::Terminator, "terminator" | "term" => MirSpanview::Terminator,
"block" | "basicblock" => MirSpanview::Block, "block" | "basicblock" => MirSpanview::Block,