File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 66
66
InnerMatcherT : for < ' a > Matcher < & ' a str > ,
67
67
{
68
68
fn matches ( & self , actual : ActualT ) -> MatcherResult {
69
- String :: from_utf8 ( actual. as_ref ( ) . to_vec ( ) )
70
- . map ( |s| self . inner . matches ( & s) )
69
+ std :: str :: from_utf8 ( actual. as_ref ( ) )
70
+ . map ( |s| self . inner . matches ( s) )
71
71
. unwrap_or ( MatcherResult :: NoMatch )
72
72
}
73
73
87
87
}
88
88
89
89
fn explain_match ( & self , actual : ActualT ) -> Description {
90
- match String :: from_utf8 ( actual. as_ref ( ) . to_vec ( ) ) {
90
+ match std :: str :: from_utf8 ( actual. as_ref ( ) ) {
91
91
Ok ( s) => {
92
- format ! ( "which is a UTF-8 encoded string {}" , self . inner. explain_match( & s) ) . into ( )
92
+ format ! ( "which is a UTF-8 encoded string {}" , self . inner. explain_match( s) ) . into ( )
93
93
}
94
94
Err ( e) => format ! ( "which is not a UTF-8 encoded string: {e}" ) . into ( ) ,
95
95
}
You can’t perform that action at this time.
0 commit comments