r/\t/ /
This commit is contained in:
parent
9c282b44c2
commit
28cc3405a8
3 changed files with 21 additions and 21 deletions
|
|
@ -1,11 +1,11 @@
|
|||
// compile-pass
|
||||
|
||||
fn main() {
|
||||
let s = &[0x00; 4][..]; //Slice of any value
|
||||
const MAGIC_TEST: &[u32] = &[4, 5, 6, 7]; //Const slice to pattern match with
|
||||
match s {
|
||||
MAGIC_TEST => (),
|
||||
[0x00, 0x00, 0x00, 0x00] => (),
|
||||
_ => (),
|
||||
}
|
||||
let s = &[0x00; 4][..]; //Slice of any value
|
||||
const MAGIC_TEST: &[u32] = &[4, 5, 6, 7]; //Const slice to pattern match with
|
||||
match s {
|
||||
MAGIC_TEST => (),
|
||||
[0x00, 0x00, 0x00, 0x00] => (),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// compile-pass
|
||||
|
||||
fn main() {
|
||||
let s = &["0x00"; 4][..]; //Slice of any value
|
||||
const MAGIC_TEST: &[&str] = &["4", "5", "6", "7"]; //Const slice to pattern match with
|
||||
match s {
|
||||
MAGIC_TEST => (),
|
||||
["0x00", "0x00", "0x00", "0x00"] => (),
|
||||
_ => (),
|
||||
}
|
||||
let s = &["0x00"; 4][..]; //Slice of any value
|
||||
const MAGIC_TEST: &[&str] = &["4", "5", "6", "7"]; //Const slice to pattern match with
|
||||
match s {
|
||||
MAGIC_TEST => (),
|
||||
["0x00", "0x00", "0x00", "0x00"] => (),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// compile-pass
|
||||
|
||||
fn main() {
|
||||
let s = &[0x00; 4][..]; //Slice of any value
|
||||
const MAGIC_TEST: &[u8] = b"TEST"; //Const slice to pattern match with
|
||||
match s {
|
||||
MAGIC_TEST => (),
|
||||
[0x00, 0x00, 0x00, 0x00] => (),
|
||||
_ => (),
|
||||
}
|
||||
let s = &[0x00; 4][..]; //Slice of any value
|
||||
const MAGIC_TEST: &[u8] = b"TEST"; //Const slice to pattern match with
|
||||
match s {
|
||||
MAGIC_TEST => (),
|
||||
[0x00, 0x00, 0x00, 0x00] => (),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue