can't call assert_eq
on packed struct fields since that takes references
This commit is contained in:
parent
d3e9e51d67
commit
a3d83e5c8f
@ -9,6 +9,11 @@ fn main() {
|
||||
a: 42,
|
||||
b: 99,
|
||||
};
|
||||
assert_eq!(x.a, 42);
|
||||
assert_eq!(x.b, 99);
|
||||
let a = x.a;
|
||||
let b = x.b;
|
||||
assert_eq!(a, 42);
|
||||
assert_eq!(b, 99);
|
||||
// can't do `assert_eq!(x.a, 42)`, because `assert_eq!` takes a reference
|
||||
assert_eq!({x.a}, 42);
|
||||
assert_eq!({x.b}, 99);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user