@@ -245,10 +245,7 @@ impl From<ByteString> for Vec<u8> {
245
245
246
246
#[ unstable( feature = "bstr" , issue = "134915" ) ]
247
247
impl < ' 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`.
252
249
#[ inline]
253
250
fn from ( s : & ' a ByteStr ) -> Self {
254
251
ByteString ( s. 0 . to_vec ( ) )
@@ -642,7 +639,7 @@ impl From<Box<ByteStr>> for Box<[u8]> {
642
639
#[ unstable( feature = "bstr" , issue = "134915" ) ]
643
640
#[ cfg( not( no_rc) ) ]
644
641
impl 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>`.
646
643
#[ inline]
647
644
fn from ( s : Rc < [ u8 ] > ) -> Rc < ByteStr > {
648
645
// SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
@@ -653,7 +650,7 @@ impl From<Rc<[u8]>> for Rc<ByteStr> {
653
650
#[ unstable( feature = "bstr" , issue = "134915" ) ]
654
651
#[ cfg( not( no_rc) ) ]
655
652
impl 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]>`.
657
654
#[ inline]
658
655
fn from ( s : Rc < ByteStr > ) -> Rc < [ u8 ] > {
659
656
// SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
@@ -664,7 +661,7 @@ impl From<Rc<ByteStr>> for Rc<[u8]> {
664
661
#[ unstable( feature = "bstr" , issue = "134915" ) ]
665
662
#[ cfg( all( not( no_rc) , not( no_sync) , target_has_atomic = "ptr" ) ) ]
666
663
impl 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]>`.
668
665
#[ inline]
669
666
fn from ( s : Arc < [ u8 ] > ) -> Arc < ByteStr > {
670
667
// SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
@@ -675,7 +672,8 @@ impl From<Arc<[u8]>> for Arc<ByteStr> {
675
672
#[ unstable( feature = "bstr" , issue = "134915" ) ]
676
673
#[ cfg( all( not( no_rc) , not( no_sync) , target_has_atomic = "ptr" ) ) ]
677
674
impl 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
+
679
677
#[ inline]
680
678
fn from ( s : Arc < ByteStr > ) -> Arc < [ u8 ] > {
681
679
// SAFETY: `ByteStr` is a transparent wrapper around `[u8]`.
0 commit comments