@@ -147,11 +147,11 @@ unsafe impl<T: ?Sized + Sync> Sync for RwLockWriteGuard<'_, T> {}
147147/// RAII structure used to release the shared read access of a lock when
148148/// dropped, which can point to a subfield of the protected data.
149149///
150- /// This structure is created by the [`map`] and [`try_map `] methods
150+ /// This structure is created by the [`map`] and [`filter_map `] methods
151151/// on [`RwLockReadGuard`].
152152///
153153/// [`map`]: RwLockReadGuard::map
154- /// [`try_map `]: RwLockReadGuard::try_map
154+ /// [`filter_map `]: RwLockReadGuard::filter_map
155155#[ must_use = "if unused the RwLock will immediately unlock" ]
156156#[ must_not_suspend = "holding a MappedRwLockReadGuard across suspend \
157157 points can cause deadlocks, delays, \
@@ -176,11 +176,11 @@ unsafe impl<T: ?Sized + Sync> Sync for MappedRwLockReadGuard<'_, T> {}
176176/// RAII structure used to release the exclusive write access of a lock when
177177/// dropped, which can point to a subfield of the protected data.
178178///
179- /// This structure is created by the [`map`] and [`try_map `] methods
179+ /// This structure is created by the [`map`] and [`filter_map `] methods
180180/// on [`RwLockWriteGuard`].
181181///
182182/// [`map`]: RwLockWriteGuard::map
183- /// [`try_map `]: RwLockWriteGuard::try_map
183+ /// [`filter_map `]: RwLockWriteGuard::filter_map
184184#[ must_use = "if unused the RwLock will immediately unlock" ]
185185#[ must_not_suspend = "holding a MappedRwLockWriteGuard across suspend \
186186 points can cause deadlocks, delays, \
@@ -788,7 +788,7 @@ impl<T: ?Sized> Deref for MappedRwLockReadGuard<'_, T> {
788788
789789 fn deref ( & self ) -> & T {
790790 // SAFETY: the conditions of `RwLockReadGuard::new` were satisfied when the original guard
791- // was created, and have been upheld throughout `map` and/or `try_map `.
791+ // was created, and have been upheld throughout `map` and/or `filter_map `.
792792 unsafe { self . data . as_ref ( ) }
793793 }
794794}
@@ -799,7 +799,7 @@ impl<T: ?Sized> Deref for MappedRwLockWriteGuard<'_, T> {
799799
800800 fn deref ( & self ) -> & T {
801801 // SAFETY: the conditions of `RwLockWriteGuard::new` were satisfied when the original guard
802- // was created, and have been upheld throughout `map` and/or `try_map `.
802+ // was created, and have been upheld throughout `map` and/or `filter_map `.
803803 unsafe { self . data . as_ref ( ) }
804804 }
805805}
@@ -808,7 +808,7 @@ impl<T: ?Sized> Deref for MappedRwLockWriteGuard<'_, T> {
808808impl < T : ?Sized > DerefMut for MappedRwLockWriteGuard < ' _ , T > {
809809 fn deref_mut ( & mut self ) -> & mut T {
810810 // SAFETY: the conditions of `RwLockWriteGuard::new` were satisfied when the original guard
811- // was created, and have been upheld throughout `map` and/or `try_map `.
811+ // was created, and have been upheld throughout `map` and/or `filter_map `.
812812 unsafe { self . data . as_mut ( ) }
813813 }
814814}
@@ -838,7 +838,7 @@ impl<T: ?Sized> Drop for RwLockWriteGuard<'_, T> {
838838impl < T : ?Sized > Drop for MappedRwLockReadGuard < ' _ , T > {
839839 fn drop ( & mut self ) {
840840 // SAFETY: the conditions of `RwLockReadGuard::new` were satisfied when the original guard
841- // was created, and have been upheld throughout `map` and/or `try_map `.
841+ // was created, and have been upheld throughout `map` and/or `filter_map `.
842842 unsafe {
843843 self . inner_lock . read_unlock ( ) ;
844844 }
@@ -850,7 +850,7 @@ impl<T: ?Sized> Drop for MappedRwLockWriteGuard<'_, T> {
850850 fn drop ( & mut self ) {
851851 self . poison_flag . done ( & self . poison ) ;
852852 // SAFETY: the conditions of `RwLockWriteGuard::new` were satisfied when the original guard
853- // was created, and have been upheld throughout `map` and/or `try_map `.
853+ // was created, and have been upheld throughout `map` and/or `filter_map `.
854854 unsafe {
855855 self . inner_lock . write_unlock ( ) ;
856856 }
@@ -878,7 +878,7 @@ impl<'a, T: ?Sized> RwLockReadGuard<'a, T> {
878878 U : ?Sized ,
879879 {
880880 // SAFETY: the conditions of `RwLockReadGuard::new` were satisfied when the original guard
881- // was created, and have been upheld throughout `map` and/or `try_map `.
881+ // was created, and have been upheld throughout `map` and/or `filter_map `.
882882 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
883883 // passed to it. If the closure panics, the guard will be dropped.
884884 let data = NonNull :: from ( f ( unsafe { orig. data . as_ref ( ) } ) ) ;
@@ -893,22 +893,21 @@ impl<'a, T: ?Sized> RwLockReadGuard<'a, T> {
893893 /// The `RwLock` is already locked for reading, so this cannot fail.
894894 ///
895895 /// This is an associated function that needs to be used as
896- /// `RwLockReadGuard::try_map (...)`. A method would interfere with methods
896+ /// `RwLockReadGuard::filter_map (...)`. A method would interfere with methods
897897 /// of the same name on the contents of the `RwLockReadGuard` used through
898898 /// `Deref`.
899899 ///
900900 /// # Panics
901901 ///
902902 /// If the closure panics, the guard will be dropped (unlocked) and the RwLock will not be poisoned.
903- #[ doc( alias = "filter_map" ) ]
904903 #[ unstable( feature = "mapped_lock_guards" , issue = "117108" ) ]
905- pub fn try_map < U , F > ( orig : Self , f : F ) -> Result < MappedRwLockReadGuard < ' a , U > , Self >
904+ pub fn filter_map < U , F > ( orig : Self , f : F ) -> Result < MappedRwLockReadGuard < ' a , U > , Self >
906905 where
907906 F : FnOnce ( & T ) -> Option < & U > ,
908907 U : ?Sized ,
909908 {
910909 // SAFETY: the conditions of `RwLockReadGuard::new` were satisfied when the original guard
911- // was created, and have been upheld throughout `map` and/or `try_map `.
910+ // was created, and have been upheld throughout `map` and/or `filter_map `.
912911 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
913912 // passed to it. If the closure panics, the guard will be dropped.
914913 match f ( unsafe { orig. data . as_ref ( ) } ) {
@@ -943,7 +942,7 @@ impl<'a, T: ?Sized> MappedRwLockReadGuard<'a, T> {
943942 U : ?Sized ,
944943 {
945944 // SAFETY: the conditions of `RwLockReadGuard::new` were satisfied when the original guard
946- // was created, and have been upheld throughout `map` and/or `try_map `.
945+ // was created, and have been upheld throughout `map` and/or `filter_map `.
947946 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
948947 // passed to it. If the closure panics, the guard will be dropped.
949948 let data = NonNull :: from ( f ( unsafe { orig. data . as_ref ( ) } ) ) ;
@@ -958,22 +957,21 @@ impl<'a, T: ?Sized> MappedRwLockReadGuard<'a, T> {
958957 /// The `RwLock` is already locked for reading, so this cannot fail.
959958 ///
960959 /// This is an associated function that needs to be used as
961- /// `MappedRwLockReadGuard::try_map (...)`. A method would interfere with
960+ /// `MappedRwLockReadGuard::filter_map (...)`. A method would interfere with
962961 /// methods of the same name on the contents of the `MappedRwLockReadGuard`
963962 /// used through `Deref`.
964963 ///
965964 /// # Panics
966965 ///
967966 /// If the closure panics, the guard will be dropped (unlocked) and the RwLock will not be poisoned.
968- #[ doc( alias = "filter_map" ) ]
969967 #[ unstable( feature = "mapped_lock_guards" , issue = "117108" ) ]
970- pub fn try_map < U , F > ( orig : Self , f : F ) -> Result < MappedRwLockReadGuard < ' a , U > , Self >
968+ pub fn filter_map < U , F > ( orig : Self , f : F ) -> Result < MappedRwLockReadGuard < ' a , U > , Self >
971969 where
972970 F : FnOnce ( & T ) -> Option < & U > ,
973971 U : ?Sized ,
974972 {
975973 // SAFETY: the conditions of `RwLockReadGuard::new` were satisfied when the original guard
976- // was created, and have been upheld throughout `map` and/or `try_map `.
974+ // was created, and have been upheld throughout `map` and/or `filter_map `.
977975 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
978976 // passed to it. If the closure panics, the guard will be dropped.
979977 match f ( unsafe { orig. data . as_ref ( ) } ) {
@@ -1008,7 +1006,7 @@ impl<'a, T: ?Sized> RwLockWriteGuard<'a, T> {
10081006 U : ?Sized ,
10091007 {
10101008 // SAFETY: the conditions of `RwLockWriteGuard::new` were satisfied when the original guard
1011- // was created, and have been upheld throughout `map` and/or `try_map `.
1009+ // was created, and have been upheld throughout `map` and/or `filter_map `.
10121010 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
10131011 // passed to it. If the closure panics, the guard will be dropped.
10141012 let data = NonNull :: from ( f ( unsafe { & mut * orig. lock . data . get ( ) } ) ) ;
@@ -1029,22 +1027,21 @@ impl<'a, T: ?Sized> RwLockWriteGuard<'a, T> {
10291027 /// The `RwLock` is already locked for writing, so this cannot fail.
10301028 ///
10311029 /// This is an associated function that needs to be used as
1032- /// `RwLockWriteGuard::try_map (...)`. A method would interfere with methods
1030+ /// `RwLockWriteGuard::filter_map (...)`. A method would interfere with methods
10331031 /// of the same name on the contents of the `RwLockWriteGuard` used through
10341032 /// `Deref`.
10351033 ///
10361034 /// # Panics
10371035 ///
10381036 /// If the closure panics, the guard will be dropped (unlocked) and the RwLock will be poisoned.
1039- #[ doc( alias = "filter_map" ) ]
10401037 #[ unstable( feature = "mapped_lock_guards" , issue = "117108" ) ]
1041- pub fn try_map < U , F > ( orig : Self , f : F ) -> Result < MappedRwLockWriteGuard < ' a , U > , Self >
1038+ pub fn filter_map < U , F > ( orig : Self , f : F ) -> Result < MappedRwLockWriteGuard < ' a , U > , Self >
10421039 where
10431040 F : FnOnce ( & mut T ) -> Option < & mut U > ,
10441041 U : ?Sized ,
10451042 {
10461043 // SAFETY: the conditions of `RwLockWriteGuard::new` were satisfied when the original guard
1047- // was created, and have been upheld throughout `map` and/or `try_map `.
1044+ // was created, and have been upheld throughout `map` and/or `filter_map `.
10481045 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
10491046 // passed to it. If the closure panics, the guard will be dropped.
10501047 match f ( unsafe { & mut * orig. lock . data . get ( ) } ) {
@@ -1147,7 +1144,7 @@ impl<'a, T: ?Sized> MappedRwLockWriteGuard<'a, T> {
11471144 U : ?Sized ,
11481145 {
11491146 // SAFETY: the conditions of `RwLockWriteGuard::new` were satisfied when the original guard
1150- // was created, and have been upheld throughout `map` and/or `try_map `.
1147+ // was created, and have been upheld throughout `map` and/or `filter_map `.
11511148 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
11521149 // passed to it. If the closure panics, the guard will be dropped.
11531150 let data = NonNull :: from ( f ( unsafe { orig. data . as_mut ( ) } ) ) ;
@@ -1168,22 +1165,21 @@ impl<'a, T: ?Sized> MappedRwLockWriteGuard<'a, T> {
11681165 /// The `RwLock` is already locked for writing, so this cannot fail.
11691166 ///
11701167 /// This is an associated function that needs to be used as
1171- /// `MappedRwLockWriteGuard::try_map (...)`. A method would interfere with
1168+ /// `MappedRwLockWriteGuard::filter_map (...)`. A method would interfere with
11721169 /// methods of the same name on the contents of the `MappedRwLockWriteGuard`
11731170 /// used through `Deref`.
11741171 ///
11751172 /// # Panics
11761173 ///
11771174 /// If the closure panics, the guard will be dropped (unlocked) and the RwLock will be poisoned.
1178- #[ doc( alias = "filter_map" ) ]
11791175 #[ unstable( feature = "mapped_lock_guards" , issue = "117108" ) ]
1180- pub fn try_map < U , F > ( mut orig : Self , f : F ) -> Result < MappedRwLockWriteGuard < ' a , U > , Self >
1176+ pub fn filter_map < U , F > ( mut orig : Self , f : F ) -> Result < MappedRwLockWriteGuard < ' a , U > , Self >
11811177 where
11821178 F : FnOnce ( & mut T ) -> Option < & mut U > ,
11831179 U : ?Sized ,
11841180 {
11851181 // SAFETY: the conditions of `RwLockWriteGuard::new` were satisfied when the original guard
1186- // was created, and have been upheld throughout `map` and/or `try_map `.
1182+ // was created, and have been upheld throughout `map` and/or `filter_map `.
11871183 // The signature of the closure guarantees that it will not "leak" the lifetime of the reference
11881184 // passed to it. If the closure panics, the guard will be dropped.
11891185 match f ( unsafe { orig. data . as_mut ( ) } ) {
0 commit comments