@@ -916,8 +916,8 @@ impl<T> Option<T> {
916
916
917
917
/// Zips `self` with another `Option`.
918
918
///
919
- /// Returns ` Some((_, _))` when both `self` and `other`
920
- /// are `Some(_)`, otherwise return `None`.
919
+ /// If `self` is ` Some(s)` and other is `Some(o)`, this method returns `Some((s, o))`.
920
+ /// Otherwise, `None` is returned .
921
921
///
922
922
/// # Examples
923
923
///
@@ -930,16 +930,15 @@ impl<T> Option<T> {
930
930
/// assert_eq!(x.zip(y), Some((1, "hi")));
931
931
/// assert_eq!(x.zip(z), None);
932
932
/// ```
933
- #[ inline]
934
- #[ unstable( feature = "option_zip" , issue = "none" ) ]
933
+ #[ unstable( feature = "option_zip" , issue = "70086" ) ]
935
934
pub fn zip < U > ( self , other : Option < U > ) -> Option < ( T , U ) > {
936
935
self . zip_with ( other, |a, b| ( a, b) )
937
936
}
938
937
939
938
/// Zips `self` and another `Option` with function `f`.
940
939
///
941
- /// Returns ` Some(_ )` when both `self` and `other`
942
- /// are `Some(_)`, otherwise return `None`.
940
+ /// If `self` is ` Some(s )` and other is `Some(o)`, this method returns `Some(f(s, o))`.
941
+ /// Otherwise, `None` is returned .
943
942
///
944
943
/// # Examples
945
944
///
@@ -958,14 +957,13 @@ impl<T> Option<T> {
958
957
/// }
959
958
/// }
960
959
///
961
- /// let x = Some(17.);
962
- /// let y = Some(42.);
960
+ /// let x = Some(17.5 );
961
+ /// let y = Some(42.7 );
963
962
///
964
- /// assert_eq!(x.zip_with(y, Point::new), Some(Point { x: 17., y: 42. }));
963
+ /// assert_eq!(x.zip_with(y, Point::new), Some(Point { x: 17.5 , y: 42.7 }));
965
964
/// assert_eq!(x.zip_with(None, Point::new), None);
966
965
/// ```
967
- #[ inline]
968
- #[ unstable( feature = "option_zip" , issue = "none" ) ]
966
+ #[ unstable( feature = "option_zip" , issue = "70086" ) ]
969
967
pub fn zip_with < U , F , R > ( self , other : Option < U > , f : F ) -> Option < R >
970
968
where
971
969
F : FnOnce ( T , U ) -> R ,
0 commit comments