@@ -245,10 +245,7 @@ impl From<ByteString> for Vec<u8> {
245245
246246#[ unstable( feature = "bstr" , issue = "134915" ) ]
247247impl < ' a > From < & ' a ByteStr > for ByteString {
248- /// Convert the `ByteStr` to a `Vec` then wrap it in a `ByteString`.
249- ///
250- /// ## Cost
251- /// Allocates a new `Vec`
248+ /// Allocates a `ByteString` containing the bytes of `ByteStr`.
252249 #[ inline]
253250 fn from ( s : & ' a ByteStr ) -> Self {
254251 ByteString ( s. 0 . to_vec ( ) )
@@ -642,7 +639,7 @@ impl From<Box<ByteStr>> for Box<[u8]> {
642639#[ unstable( feature = "bstr" , issue = "134915" ) ]
643640#[ cfg( not( no_rc) ) ]
644641impl From < Rc < [ u8 ] > > for Rc < ByteStr > {
645- /// Create a `Rc<[u8]>` from `Rc<ByteStr>`s raw .
642+ /// Create an `Rc<[u8]>` from the inner bytes of `Rc<ByteStr>`.
646643 #[ inline]
647644 fn from ( s : Rc < [ u8 ] > ) -> Rc < ByteStr > {
648645 // SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
@@ -653,7 +650,7 @@ impl From<Rc<[u8]>> for Rc<ByteStr> {
653650#[ unstable( feature = "bstr" , issue = "134915" ) ]
654651#[ cfg( not( no_rc) ) ]
655652impl From < Rc < ByteStr > > for Rc < [ u8 ] > {
656- /// Create a `Rc<ByteStr>` from `Rc<[u8]>`s raw .
653+ /// Create a `Rc<ByteStr>` from the bytes of `Rc<[u8]>`.
657654 #[ inline]
658655 fn from ( s : Rc < ByteStr > ) -> Rc < [ u8 ] > {
659656 // SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
@@ -664,7 +661,7 @@ impl From<Rc<ByteStr>> for Rc<[u8]> {
664661#[ unstable( feature = "bstr" , issue = "134915" ) ]
665662#[ cfg( all( not( no_rc) , not( no_sync) , target_has_atomic = "ptr" ) ) ]
666663impl From < Arc < [ u8 ] > > for Arc < ByteStr > {
667- /// Create a `Arc<ByteStr>` from `Arc<[u8]>`s raw .
664+ /// Create an `Arc<ByteStr>` from the bytes of `Arc<[u8]>`.
668665 #[ inline]
669666 fn from ( s : Arc < [ u8 ] > ) -> Arc < ByteStr > {
670667 // SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
@@ -675,7 +672,8 @@ impl From<Arc<[u8]>> for Arc<ByteStr> {
675672#[ unstable( feature = "bstr" , issue = "134915" ) ]
676673#[ cfg( all( not( no_rc) , not( no_sync) , target_has_atomic = "ptr" ) ) ]
677674impl From < Arc < ByteStr > > for Arc < [ u8 ] > {
678- /// Create a `Arc<ByteStr>` from `Arc<[u8]>`s raw.
675+ /// Create a `Arc<[u8]>` from the inner bytes of `Arc<ByteStr>`.
676+
679677 #[ inline]
680678 fn from ( s : Arc < ByteStr > ) -> Arc < [ u8 ] > {
681679 // SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
0 commit comments