mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Reduce some more code duplication
This commit is contained in:
parent
2cd2947bf8
commit
83121efcd5
5 changed files with 76 additions and 94 deletions
|
@ -124,51 +124,6 @@ use Option::*;
|
|||
fn main() -> Option<i32> {
|
||||
Some($0)
|
||||
}
|
||||
"#,
|
||||
);
|
||||
check_edit(
|
||||
"Some",
|
||||
r#"
|
||||
enum Option<T> { Some(T), None }
|
||||
use Option::*;
|
||||
fn main(value: Option<i32>) {
|
||||
match value {
|
||||
Som<|>
|
||||
}
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
enum Option<T> { Some(T), None }
|
||||
use Option::*;
|
||||
fn main(value: Option<i32>) {
|
||||
match value {
|
||||
Some($0)
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dont_duplicate_pattern_parens() {
|
||||
mark::check!(dont_duplicate_pattern_parens);
|
||||
check_edit(
|
||||
"Var",
|
||||
r#"
|
||||
enum E { Var(i32) }
|
||||
fn main() {
|
||||
match E::Var(92) {
|
||||
E::<|>(92) => (),
|
||||
}
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
enum E { Var(i32) }
|
||||
fn main() {
|
||||
match E::Var(92) {
|
||||
E::Var(92) => (),
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue