mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
rustup (rustc 1.0.0-nightly (00978a987 2015-04-18) (built 2015-04-19))
This commit is contained in:
parent
ab65383f64
commit
2935c31692
2 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
#![feature(plugin_registrar, box_syntax)]
|
||||
#![feature(rustc_private, core, collections)]
|
||||
#![feature(rustc_private, collections)]
|
||||
|
||||
#![allow(unused_imports)]
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ impl LintPass for MiscPass {
|
|||
let map = cx.sess().codemap();
|
||||
span_note_and_lint(cx, SINGLE_MATCH, expr.span,
|
||||
"You seem to be trying to use match for destructuring a single type. Did you mean to use `if let`?",
|
||||
format!("Try if let {} = {} {{ ... }}",
|
||||
map.span_to_snippet(arms[0].pats[0].span).unwrap_or("..".to_string()),
|
||||
map.span_to_snippet(ex.span).unwrap_or("..".to_string())).as_slice()
|
||||
&*format!("Try if let {} = {} {{ ... }}",
|
||||
&*map.span_to_snippet(arms[0].pats[0].span).unwrap_or("..".to_string()),
|
||||
&*map.span_to_snippet(ex.span).unwrap_or("..".to_string()))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue