File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 1
1
#![ cfg_attr( rustfmt, rustfmt_skip) ]
2
2
3
3
use std:: { fmt, mem} ;
4
- use std:: borrow:: { Borrow , Cow } ;
4
+ use std:: borrow:: { Borrow , BorrowMut , Cow } ;
5
5
use std:: error:: Error ;
6
6
use std:: any:: Any ;
7
7
use std:: str:: FromStr ;
@@ -418,6 +418,13 @@ impl Borrow<AsciiStr> for AsciiString {
418
418
}
419
419
}
420
420
421
+ impl BorrowMut < AsciiStr > for AsciiString {
422
+ #[ inline]
423
+ fn borrow_mut ( & mut self ) -> & mut AsciiStr {
424
+ & mut * self
425
+ }
426
+ }
427
+
421
428
impl From < Vec < AsciiChar > > for AsciiString {
422
429
#[ inline]
423
430
fn from ( vec : Vec < AsciiChar > ) -> Self {
@@ -474,20 +481,41 @@ impl AsRef<AsciiStr> for AsciiString {
474
481
}
475
482
}
476
483
484
+ impl AsRef < [ AsciiChar ] > for AsciiString {
485
+ #[ inline]
486
+ fn as_ref ( & self ) -> & [ AsciiChar ] {
487
+ & self . vec
488
+ }
489
+ }
490
+
477
491
impl AsRef < [ u8 ] > for AsciiString {
478
492
#[ inline]
479
493
fn as_ref ( & self ) -> & [ u8 ] {
480
494
self . as_bytes ( )
481
495
}
482
496
}
483
497
498
+ impl AsRef < str > for AsciiString {
499
+ #[ inline]
500
+ fn as_ref ( & self ) -> & str {
501
+ self . as_str ( )
502
+ }
503
+ }
504
+
484
505
impl AsMut < AsciiStr > for AsciiString {
485
506
#[ inline]
486
507
fn as_mut ( & mut self ) -> & mut AsciiStr {
487
508
& mut * self
488
509
}
489
510
}
490
511
512
+ impl AsMut < [ AsciiChar ] > for AsciiString {
513
+ #[ inline]
514
+ fn as_mut ( & mut self ) -> & mut [ AsciiChar ] {
515
+ & mut self . vec
516
+ }
517
+ }
518
+
491
519
impl FromStr for AsciiString {
492
520
type Err = AsAsciiStrError ;
493
521
You can’t perform that action at this time.
0 commit comments