rustfmt
This commit is contained in:
parent
e256055dc4
commit
bd45cfd273
18 changed files with 137 additions and 203 deletions
|
|
@ -31,17 +31,16 @@ fn var2str(var: &Variant) -> InternedString {
|
|||
var.node.name.name.as_str()
|
||||
}
|
||||
|
||||
/*
|
||||
FIXME: waiting for https://github.com/rust-lang/rust/pull/31700
|
||||
fn partial_match(pre: &str, name: &str) -> usize {
|
||||
// skip(1) to ensure that the prefix never takes the whole variant name
|
||||
pre.chars().zip(name.chars().rev().skip(1).rev()).take_while(|&(l, r)| l == r).count()
|
||||
}
|
||||
|
||||
fn partial_rmatch(post: &str, name: &str) -> usize {
|
||||
// skip(1) to ensure that the postfix never takes the whole variant name
|
||||
post.chars().rev().zip(name.chars().skip(1).rev()).take_while(|&(l, r)| l == r).count()
|
||||
}*/
|
||||
// FIXME: waiting for https://github.com/rust-lang/rust/pull/31700
|
||||
// fn partial_match(pre: &str, name: &str) -> usize {
|
||||
// // skip(1) to ensure that the prefix never takes the whole variant name
|
||||
// pre.chars().zip(name.chars().rev().skip(1).rev()).take_while(|&(l, r)| l == r).count()
|
||||
// }
|
||||
//
|
||||
// fn partial_rmatch(post: &str, name: &str) -> usize {
|
||||
// // skip(1) to ensure that the postfix never takes the whole variant name
|
||||
// post.chars().rev().zip(name.chars().skip(1).rev()).take_while(|&(l, r)| l == r).count()
|
||||
// }
|
||||
|
||||
fn partial_match(pre: &str, name: &str) -> usize {
|
||||
let mut name_iter = name.chars();
|
||||
|
|
@ -99,7 +98,8 @@ impl EarlyLintPass for EnumVariantNames {
|
|||
item.span,
|
||||
&format!("All variants have the same {}fix: `{}`", what, value),
|
||||
&format!("remove the {}fixes and use full paths to \
|
||||
the variants instead of glob imports", what));
|
||||
the variants instead of glob imports",
|
||||
what));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue