File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -242,13 +242,13 @@ pub struct LevelFilterFromStrError(String);
242
242
impl FromStr for LevelFilter {
243
243
type Err = LevelFilterFromStrError ;
244
244
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
245
- match s {
246
- "Off" | "OFF " => Ok ( Self :: Off ) ,
247
- "Trace" | "TRACE " => Ok ( Self :: Trace ) ,
248
- "Debug" | "DEBUG " => Ok ( Self :: Debug ) ,
249
- "Info" | "INFO " => Ok ( Self :: Info ) ,
250
- "Warn " | "WARN" | "Warning" | "WARNING " => Ok ( Self :: Warn ) ,
251
- "Error" | "ERROR " => Ok ( Self :: Error ) ,
245
+ match s. to_ascii_lowercase ( ) {
246
+ "off " => Ok ( Self :: Off ) ,
247
+ "trace " => Ok ( Self :: Trace ) ,
248
+ "debug " => Ok ( Self :: Debug ) ,
249
+ "info " => Ok ( Self :: Info ) ,
250
+ "warn " | "warning " => Ok ( Self :: Warn ) ,
251
+ "error " => Ok ( Self :: Error ) ,
252
252
_ => Err ( LevelFilterFromStrError ( String :: from ( s) ) ) ,
253
253
}
254
254
}
You can’t perform that action at this time.
0 commit comments