mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
happy slice
This commit is contained in:
parent
8deadb18ae
commit
5e4370fe56
@ -791,4 +791,39 @@ fn func(binary: &[u8]) {
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn merge_match_arms_slice_identical() {
|
||||
check_assist(
|
||||
merge_match_arms,
|
||||
r#"
|
||||
fn func(binary: &[u8]) {
|
||||
let space = b' ';
|
||||
match binary {
|
||||
[space, 5u8] => $0"",
|
||||
[space] => "",
|
||||
_ => "other",
|
||||
};
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
fn func(binary: &[u8]) {
|
||||
let space = b' ';
|
||||
match binary {
|
||||
[space, 5u8] | [space] => "",
|
||||
_ => "other",
|
||||
};
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn func(binary: &[u8]) {
|
||||
let space = b' ';
|
||||
match binary {
|
||||
[space, 5u8] => "",
|
||||
[space] => "",
|
||||
_ => "other",
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user