We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
core::result
1 parent a1c452d commit 8b6802cCopy full SHA for 8b6802c
library/coretests/tests/result.rs
@@ -44,6 +44,18 @@ fn test_or_else() {
44
assert_eq!(op2().or_else(|e| Err::<isize, &'static str>(e)).unwrap_err(), "sadface");
45
}
46
47
+#[test]
48
+fn test_map_or() {
49
+ assert_eq!(op1().map_or(667, |x| x), 666);
50
+ assert_eq!(op2().map_or(666, |_| panic!()), 666);
51
+}
52
+
53
54
+fn test_copied() {
55
+ assert!(Ok::<&isize, isize>(&1).copied() == Ok(1));
56
+ assert!(Err::<&isize, isize>(1).copied() == Err(1));
57
58
59
#[test]
60
fn test_impl_map() {
61
assert!(Ok::<isize, isize>(1).map(|x| x + 1) == Ok(2));
0 commit comments