From ce5d69480a644011acedd3072eaef61cd72e5850 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 2 Apr 2019 22:09:56 +0000 Subject: Add must_use annotations to Result::is_ok and is_err --- src/librustc_data_structures/owning_ref/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/librustc_data_structures') diff --git a/src/librustc_data_structures/owning_ref/mod.rs b/src/librustc_data_structures/owning_ref/mod.rs index 236559dcd7c..0301891c9b2 100644 --- a/src/librustc_data_structures/owning_ref/mod.rs +++ b/src/librustc_data_structures/owning_ref/mod.rs @@ -1471,7 +1471,7 @@ mod tests { let x = Box::new(123_i32); let y: Box = x; - OwningRef::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_ok(); + assert!(OwningRef::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_ok()); } #[test] @@ -1481,7 +1481,7 @@ mod tests { let x = Box::new(123_i32); let y: Box = x; - OwningRef::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_err(); + assert!(!OwningRef::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_err()); } } @@ -1868,7 +1868,7 @@ mod tests { let x = Box::new(123_i32); let y: Box = x; - OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::().ok_or(())).is_ok(); + assert!(OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::().ok_or(())).is_ok()); } #[test] @@ -1878,7 +1878,7 @@ mod tests { let x = Box::new(123_i32); let y: Box = x; - OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::().ok_or(())).is_err(); + assert!(!OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::().ok_or(())).is_err()); } #[test] @@ -1888,7 +1888,7 @@ mod tests { let x = Box::new(123_i32); let y: Box = x; - OwningRefMut::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_ok(); + assert!(OwningRefMut::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_ok()); } #[test] @@ -1898,7 +1898,7 @@ mod tests { let x = Box::new(123_i32); let y: Box = x; - OwningRefMut::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_err(); + assert!(!OwningRefMut::new(y).try_map(|x| x.downcast_ref::().ok_or(())).is_err()); } #[test] -- cgit 1.4.1-3-g733a5