File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 11use crate :: error:: SpecifierError ;
22use std:: borrow:: Cow ;
33
4- #[ derive( Debug , Eq , PartialEq ) ]
4+ #[ derive( Debug ) ]
55pub struct Specifier < ' a > {
66 path : Cow < ' a , str > ,
77 pub query : Option < & ' a str > ,
@@ -82,14 +82,21 @@ impl<'a> Specifier<'a> {
8282mod tests {
8383 use super :: { Specifier , SpecifierError } ;
8484
85+ #[ test]
86+ fn debug ( ) {
87+ let specifier = Specifier :: parse ( "/" ) . unwrap ( ) ;
88+ assert_eq ! (
89+ format!( "{specifier:?}" ) ,
90+ r#"Specifier { path: "/", query: None, fragment: None }"#
91+ ) ;
92+ }
93+
8594 #[ test]
8695 fn empty ( ) {
8796 let specifiers = [ "" , "?" ] ;
8897 for specifier in specifiers {
89- assert_eq ! (
90- Specifier :: parse( specifier) ,
91- Err ( SpecifierError :: Empty ( specifier. to_string( ) ) )
92- ) ;
98+ let error = Specifier :: parse ( specifier) . unwrap_err ( ) ;
99+ assert_eq ! ( error, SpecifierError :: Empty ( specifier. to_string( ) ) ) ;
93100 }
94101 }
95102
You can’t perform that action at this time.
0 commit comments