@@ -36,7 +36,7 @@ impl Platform<'_> {
3636 parts. pop_back ( ) ;
3737 }
3838
39- if parts. len ( ) > 2 && !DOTTED_PATTERN . is_match ( & parts. back ( ) . unwrap ( ) ) {
39+ if parts. len ( ) > 2 && !DOTTED_PATTERN . is_match ( parts. back ( ) . unwrap ( ) ) {
4040 let extra = parts. pop_back ( ) . unwrap ( ) ;
4141 let last = parts. pop_back ( ) . unwrap ( ) ;
4242 let e = last. as_ptr ( ) ;
@@ -51,7 +51,7 @@ impl Platform<'_> {
5151 if cpu. is_empty ( ) {
5252 panic ! ( "empty cpu in platform {:?}" , s) ;
5353 }
54- if I86_PATTERN . is_match ( & cpu) {
54+ if I86_PATTERN . is_match ( cpu) {
5555 Some ( "x86" )
5656 } else {
5757 Some ( cpu)
@@ -60,7 +60,7 @@ impl Platform<'_> {
6060 None => panic ! ( "empty cpu in platform {:?}" , s) ,
6161 } ;
6262
63- if parts. len ( ) == 2 && DOTTED_PATTERN . is_match ( & parts[ 1 ] ) {
63+ if parts. len ( ) == 2 && DOTTED_PATTERN . is_match ( parts[ 1 ] ) {
6464 return Platform {
6565 cpu,
6666 os : parts. pop_front ( ) . unwrap ( ) ,
@@ -121,7 +121,7 @@ impl Platform<'_> {
121121
122122 let mut double_locs = MSWIN_PATTERN . capture_locations ( ) ;
123123
124- if MSWIN_PATTERN . captures_read ( & mut double_locs, & os) . is_some ( ) {
124+ if MSWIN_PATTERN . captures_read ( & mut double_locs, os) . is_some ( ) {
125125 version = capture ( & double_locs, os, 2 ) ;
126126 os = capture ( & double_locs, os, 1 ) . unwrap ( ) ;
127127 if cpu. is_none ( ) && os. ends_with ( "32" ) {
@@ -137,16 +137,13 @@ impl Platform<'_> {
137137
138138 os = "unknown" ;
139139
140- return Platform { cpu, os, version } ;
140+ Platform { cpu, os, version }
141141 }
142142}
143143
144144impl std:: fmt:: Display for Platform < ' _ > {
145145 fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
146- match ( & self . cpu , & self . os , & self . version ) {
147- ( None , os, Some ( version) ) => return write ! ( f, "{}{}" , os, version) ,
148- _ => ( ) ,
149- }
146+ if let ( None , os, Some ( version) ) = ( & self . cpu , & self . os , & self . version ) { return write ! ( f, "{}{}" , os, version) }
150147 if let Some ( cpu) = self . cpu {
151148 write ! ( f, "{}-" , cpu) ?;
152149 }
0 commit comments