@@ -542,26 +542,26 @@ impl<T, E> Result<T, E> {
542542 matches ! ( * self , Ok ( _) )
543543 }
544544
545- /// Returns `true` if the result is [`Ok`] wrapping a value matching the predicate.
545+ /// Returns `true` if the result is [`Ok`] and the value inside of it matches a predicate.
546546 ///
547547 /// # Examples
548548 ///
549549 /// ```
550550 /// #![feature(is_some_with)]
551551 ///
552552 /// let x: Result<u32, &str> = Ok(2);
553- /// assert_eq!(x.is_ok_with (|&x| x > 1), true);
553+ /// assert_eq!(x.is_ok_and (|&x| x > 1), true);
554554 ///
555555 /// let x: Result<u32, &str> = Ok(0);
556- /// assert_eq!(x.is_ok_with (|&x| x > 1), false);
556+ /// assert_eq!(x.is_ok_and (|&x| x > 1), false);
557557 ///
558558 /// let x: Result<u32, &str> = Err("hey");
559- /// assert_eq!(x.is_ok_with (|&x| x > 1), false);
559+ /// assert_eq!(x.is_ok_and (|&x| x > 1), false);
560560 /// ```
561561 #[ must_use]
562562 #[ inline]
563563 #[ unstable( feature = "is_some_with" , issue = "93050" ) ]
564- pub fn is_ok_with ( & self , f : impl FnOnce ( & T ) -> bool ) -> bool {
564+ pub fn is_ok_and ( & self , f : impl FnOnce ( & T ) -> bool ) -> bool {
565565 matches ! ( self , Ok ( x) if f( x) )
566566 }
567567
@@ -586,7 +586,7 @@ impl<T, E> Result<T, E> {
586586 !self . is_ok ( )
587587 }
588588
589- /// Returns `true` if the result is [`Err`] wrapping a value matching the predicate.
589+ /// Returns `true` if the result is [`Err`] and the value inside of it matches a predicate.
590590 ///
591591 /// # Examples
592592 ///
@@ -595,18 +595,18 @@ impl<T, E> Result<T, E> {
595595 /// use std::io::{Error, ErrorKind};
596596 ///
597597 /// let x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));
598- /// assert_eq!(x.is_err_with (|x| x.kind() == ErrorKind::NotFound), true);
598+ /// assert_eq!(x.is_err_and (|x| x.kind() == ErrorKind::NotFound), true);
599599 ///
600600 /// let x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, "!"));
601- /// assert_eq!(x.is_err_with (|x| x.kind() == ErrorKind::NotFound), false);
601+ /// assert_eq!(x.is_err_and (|x| x.kind() == ErrorKind::NotFound), false);
602602 ///
603603 /// let x: Result<u32, Error> = Ok(123);
604- /// assert_eq!(x.is_err_with (|x| x.kind() == ErrorKind::NotFound), false);
604+ /// assert_eq!(x.is_err_and (|x| x.kind() == ErrorKind::NotFound), false);
605605 /// ```
606606 #[ must_use]
607607 #[ inline]
608608 #[ unstable( feature = "is_some_with" , issue = "93050" ) ]
609- pub fn is_err_with ( & self , f : impl FnOnce ( & E ) -> bool ) -> bool {
609+ pub fn is_err_and ( & self , f : impl FnOnce ( & E ) -> bool ) -> bool {
610610 matches ! ( self , Err ( x) if f( x) )
611611 }
612612
0 commit comments