Use assert_eq! rather than assert! where possible
This commit is contained in:
parent
3acf37897a
commit
cc57ca012a
641 changed files with 2809 additions and 2809 deletions
|
@ -19,7 +19,7 @@ struct I { i: int }
|
|||
|
||||
fn test_rec() {
|
||||
let rs = if true { I {i: 100} } else { I {i: 101} };
|
||||
assert!((rs.i == 100));
|
||||
assert_eq!(rs.i, 100);
|
||||
}
|
||||
|
||||
enum mood { happy, sad, }
|
||||
|
@ -33,7 +33,7 @@ impl cmp::Eq for mood {
|
|||
|
||||
fn test_tag() {
|
||||
let rs = if true { happy } else { sad };
|
||||
assert!((rs == happy));
|
||||
assert_eq!(rs, happy);
|
||||
}
|
||||
|
||||
pub fn main() { test_rec(); test_tag(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue