File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1505,6 +1505,20 @@ impl<'a> From<&'a str> for Vec<u8> {
1505
1505
// Clone-on-write
1506
1506
////////////////////////////////////////////////////////////////////////////////
1507
1507
1508
+ #[ stable( feature = "cow_from_vec" , since = "1.7.0" ) ]
1509
+ impl < ' a , T : Clone > From < & ' a [ T ] > for Cow < ' a , [ T ] > {
1510
+ fn from ( s : & ' a [ T ] ) -> Cow < ' a , [ T ] > {
1511
+ Cow :: Borrowed ( s)
1512
+ }
1513
+ }
1514
+
1515
+ #[ stable( feature = "cow_from_vec" , since = "1.7.0" ) ]
1516
+ impl < ' a , T : Clone > From < Vec < T > > for Cow < ' a , [ T ] > {
1517
+ fn from ( v : Vec < T > ) -> Cow < ' a , [ T ] > {
1518
+ Cow :: Owned ( v)
1519
+ }
1520
+ }
1521
+
1508
1522
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1509
1523
impl < ' a , T > FromIterator < T > for Cow < ' a , [ T ] > where T : Clone {
1510
1524
fn from_iter < I : IntoIterator < Item = T > > ( it : I ) -> Cow < ' a , [ T ] > {
You can’t perform that action at this time.
0 commit comments