Rollup merge of #64717 - andrewbanchich:master, r=joshtriplett

update mem::discriminant test to use assert_eq and assert_ne over comparison operators

Use assert_eq and assert_ne over comparison operators.
This commit is contained in:
Mazdak Farrokhzad 2019-09-24 23:45:28 +02:00 committed by GitHub
commit 8db83a04c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -818,9 +818,9 @@ impl<T> fmt::Debug for Discriminant<T> {
/// ///
/// enum Foo { A(&'static str), B(i32), C(i32) } /// enum Foo { A(&'static str), B(i32), C(i32) }
/// ///
/// assert!(mem::discriminant(&Foo::A("bar")) == mem::discriminant(&Foo::A("baz"))); /// assert_eq!(mem::discriminant(&Foo::A("bar")), mem::discriminant(&Foo::A("baz")));
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2))); /// assert_eq!(mem::discriminant(&Foo::B(1)), mem::discriminant(&Foo::B(2)));
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3))); /// assert_ne!(mem::discriminant(&Foo::B(3)), mem::discriminant(&Foo::C(3)));
/// ``` /// ```
#[stable(feature = "discriminant_value", since = "1.21.0")] #[stable(feature = "discriminant_value", since = "1.21.0")]
pub fn discriminant<T>(v: &T) -> Discriminant<T> { pub fn discriminant<T>(v: &T) -> Discriminant<T> {