mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
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:
commit
8db83a04c5
@ -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> {
|
||||||
|
Loading…
Reference in New Issue
Block a user