Skip to content

Commit

Permalink
Rollup merge of rust-lang#64717 - andrewbanchich:master, r=joshtriplett
Browse files Browse the repository at this point in the history
update mem::discriminant test to use assert_eq and assert_ne over comparison operators

Use assert_eq and assert_ne over comparison operators.
  • Loading branch information
Centril authored Sep 24, 2019
2 parents 9e12827 + 8acf958 commit 8db83a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libcore/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,9 @@ impl<T> fmt::Debug for Discriminant<T> {
///
/// enum Foo { A(&'static str), B(i32), C(i32) }
///
/// assert!(mem::discriminant(&Foo::A("bar")) == mem::discriminant(&Foo::A("baz")));
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
/// assert_eq!(mem::discriminant(&Foo::A("bar")), mem::discriminant(&Foo::A("baz")));
/// assert_eq!(mem::discriminant(&Foo::B(1)), mem::discriminant(&Foo::B(2)));
/// assert_ne!(mem::discriminant(&Foo::B(3)), mem::discriminant(&Foo::C(3)));
/// ```
#[stable(feature = "discriminant_value", since = "1.21.0")]
pub fn discriminant<T>(v: &T) -> Discriminant<T> {
Expand Down

0 comments on commit 8db83a0

Please sign in to comment.