Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
18
third-party/vendor/is-macro/tests/as_mut.rs
vendored
Normal file
18
third-party/vendor/is-macro/tests/as_mut.rs
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use is_macro::Is;
|
||||
|
||||
#[derive(Debug, PartialEq, Is)]
|
||||
pub enum Enum {
|
||||
A(u32),
|
||||
B(Vec<u32>),
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test() {
|
||||
let mut e = Enum::A(0);
|
||||
*e.as_mut_a().unwrap() += 1;
|
||||
assert_eq!(e, Enum::A(1));
|
||||
|
||||
let mut e = Enum::B(vec![]);
|
||||
e.as_mut_b().unwrap().push(1);
|
||||
assert_eq!(e, Enum::B(vec![1]));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue