@@ -2128,7 +2128,7 @@ where
2128
2128
2129
2129
#[ cfg( not( no_global_oom_handling) ) ]
2130
2130
#[ stable( feature = "herd_cows" , since = "1.19.0" ) ]
2131
- impl < ' a , const COOP_PREFERRED : bool > FromIterator < Cow < ' a , str > > for String < COOP_PREFERRED >
2131
+ impl < ' a , const COOP_PREFERRED : bool > FromIterator < Cow < ' a , str , COOP_PREFERRED > > for String < COOP_PREFERRED >
2132
2132
where
2133
2133
[ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
2134
2134
{
@@ -2238,16 +2238,16 @@ where
2238
2238
2239
2239
#[ cfg( not( no_global_oom_handling) ) ]
2240
2240
#[ stable( feature = "herd_cows" , since = "1.19.0" ) ]
2241
- impl < ' a , const COOP_PREFERRED : bool > Extend < Cow < ' a , str > > for String < COOP_PREFERRED >
2241
+ impl < ' a , const COOP_PREFERRED : bool > Extend < Cow < ' a , str , COOP_PREFERRED > > for String < COOP_PREFERRED >
2242
2242
where
2243
2243
[ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
2244
2244
{
2245
- fn extend < I : IntoIterator < Item = Cow < ' a , str > > > ( & mut self , iter : I ) {
2245
+ fn extend < I : IntoIterator < Item = Cow < ' a , str , COOP_PREFERRED > > > ( & mut self , iter : I ) {
2246
2246
iter. into_iter ( ) . for_each ( move |s| self . push_str ( & s) ) ;
2247
2247
}
2248
2248
2249
2249
#[ inline]
2250
- fn extend_one ( & mut self , s : Cow < ' a , str > ) {
2250
+ fn extend_one ( & mut self , s : Cow < ' a , str , COOP_PREFERRED > ) {
2251
2251
self . push_str ( & s) ;
2252
2252
}
2253
2253
}
@@ -2789,7 +2789,7 @@ where
2789
2789
2790
2790
#[ cfg( not( no_global_oom_handling) ) ]
2791
2791
#[ stable( feature = "cow_str_to_string_specialization" , since = "1.17.0" ) ]
2792
- impl < const COOP_PREFERRED : bool > ToString < COOP_PREFERRED > for Cow < ' _ , str >
2792
+ impl < const COOP_PREFERRED : bool > ToString < COOP_PREFERRED > for Cow < ' _ , str , COOP_PREFERRED >
2793
2793
where
2794
2794
[ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
2795
2795
{
@@ -2940,7 +2940,7 @@ where
2940
2940
2941
2941
#[ cfg( not( no_global_oom_handling) ) ]
2942
2942
#[ stable( feature = "string_from_cow_str" , since = "1.14.0" ) ]
2943
- impl < ' a , const COOP_PREFERRED : bool > From < Cow < ' a , str > > for String < COOP_PREFERRED >
2943
+ impl < ' a , const COOP_PREFERRED : bool > From < Cow < ' a , str , COOP_PREFERRED > > for String < COOP_PREFERRED >
2944
2944
where
2945
2945
[ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
2946
2946
{
@@ -2967,7 +2967,10 @@ where
2967
2967
2968
2968
#[ cfg( not( no_global_oom_handling) ) ]
2969
2969
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2970
- impl < ' a > From < & ' a str > for Cow < ' a , str > {
2970
+ impl < ' a , const COOP_PREFERRED : bool > From < & ' a str > for Cow < ' a , str , COOP_PREFERRED >
2971
+ where
2972
+ [ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
2973
+ {
2971
2974
/// Converts a string slice into a [`Borrowed`] variant.
2972
2975
/// No heap allocation is performed, and the string
2973
2976
/// is not copied.
@@ -2981,14 +2984,14 @@ impl<'a> From<&'a str> for Cow<'a, str> {
2981
2984
///
2982
2985
/// [`Borrowed`]: crate::borrow::Cow::Borrowed "borrow::Cow::Borrowed"
2983
2986
#[ inline]
2984
- fn from ( s : & ' a str ) -> Cow < ' a , str > {
2987
+ fn from ( s : & ' a str ) -> Cow < ' a , str , COOP_PREFERRED > {
2985
2988
Cow :: Borrowed ( s)
2986
2989
}
2987
2990
}
2988
2991
2989
2992
#[ cfg( not( no_global_oom_handling) ) ]
2990
2993
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2991
- impl < ' a , const COOP_PREFERRED : bool > From < String < COOP_PREFERRED > > for Cow < ' a , str >
2994
+ impl < ' a , const COOP_PREFERRED : bool > From < String < COOP_PREFERRED > > for Cow < ' a , str , COOP_PREFERRED >
2992
2995
where
2993
2996
[ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
2994
2997
{
@@ -3039,16 +3042,22 @@ where
3039
3042
3040
3043
#[ cfg( not( no_global_oom_handling) ) ]
3041
3044
#[ stable( feature = "cow_str_from_iter" , since = "1.12.0" ) ]
3042
- impl < ' a > FromIterator < char > for Cow < ' a , str > {
3043
- fn from_iter < I : IntoIterator < Item = char > > ( it : I ) -> Cow < ' a , str > {
3045
+ impl < ' a , const COOP_PREFERRED : bool > FromIterator < char > for Cow < ' a , str , COOP_PREFERRED >
3046
+ where
3047
+ [ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
3048
+ {
3049
+ fn from_iter < I : IntoIterator < Item = char > > ( it : I ) -> Cow < ' a , str , COOP_PREFERRED > {
3044
3050
Cow :: Owned ( FromIterator :: from_iter ( it) )
3045
3051
}
3046
3052
}
3047
3053
3048
3054
#[ cfg( not( no_global_oom_handling) ) ]
3049
3055
#[ stable( feature = "cow_str_from_iter" , since = "1.12.0" ) ]
3050
- impl < ' a , ' b > FromIterator < & ' b str > for Cow < ' a , str > {
3051
- fn from_iter < I : IntoIterator < Item = & ' b str > > ( it : I ) -> Cow < ' a , str > {
3056
+ impl < ' a , ' b , const COOP_PREFERRED : bool > FromIterator < & ' b str > for Cow < ' a , str , COOP_PREFERRED >
3057
+ where
3058
+ [ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
3059
+ {
3060
+ fn from_iter < I : IntoIterator < Item = & ' b str > > ( it : I ) -> Cow < ' a , str , COOP_PREFERRED > {
3052
3061
Cow :: Owned ( FromIterator :: from_iter ( it) )
3053
3062
}
3054
3063
}
0 commit comments