File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,15 @@ where
3535
3636/// Attempts to convert a `TagItem` to a number, passing it to `setter`
3737pub ( crate ) fn set_number < F : FnMut ( u32 ) > ( item : & TagItem , mut setter : F ) {
38- let text = item. value ( ) . text ( ) . map ( str :: trim ) ;
38+ let text = item. value ( ) . text ( ) ;
3939
40- let trimmed;
41- match text {
42- None | Some ( "" ) => {
43- log:: warn!( "Value does not have text in {:?}" , item. key( ) ) ;
44- return ;
45- } ,
46- Some ( trimmed_text) => trimmed = trimmed_text,
40+ let trimmed_text = text. unwrap_or_default ( ) . trim ( ) ;
41+ if trimmed_text. is_empty ( ) {
42+ log:: warn!( "Value does not have text in {:?}" , item. key( ) ) ;
43+ return ;
4744 }
4845
49- match trimmed . parse :: < u32 > ( ) {
46+ match trimmed_text . parse :: < u32 > ( ) {
5047 Ok ( number) => setter ( number) ,
5148 Err ( parse_error) => {
5249 log:: warn!(
You can’t perform that action at this time.
0 commit comments