File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,10 +49,8 @@ fn app() -> Element {
4949 let mut input_operator = move |key : & str | val. push_str ( key) ;
5050
5151 let handle_key_down_event = move |evt : KeyboardEvent | match evt. key ( ) {
52- Key :: Backspace => {
53- if !val ( ) . is_empty ( ) {
54- val. pop ( ) ;
55- }
52+ Key :: Backspace if !val ( ) . is_empty ( ) => {
53+ val. pop ( ) ;
5654 }
5755 Key :: Character ( character) => match character. as_str ( ) {
5856 "+" | "-" | "/" | "*" => input_operator ( & character) ,
Original file line number Diff line number Diff line change @@ -505,10 +505,8 @@ impl AppBuilder {
505505 krate,
506506 fresh,
507507 ..
508- } => {
509- if !fresh {
510- tracing:: info!( "Compiled [{current:>3}/{total}]: {krate}" ) ;
511- }
508+ } if !fresh => {
509+ tracing:: info!( "Compiled [{current:>3}/{total}]: {krate}" ) ;
512510 }
513511 BuildStage :: RunningBindgen => tracing:: info!( "Running wasm-bindgen..." ) ,
514512 BuildStage :: CopyingAssets {
Original file line number Diff line number Diff line change @@ -1136,14 +1136,12 @@ impl BuildRequest {
11361136
11371137 // todo: this can occasionally swallow errors, so we should figure out what exactly is going wrong
11381138 // since that is a really bad user experience.
1139- Message :: BuildFinished ( finished) => {
1140- if !finished. success {
1141- bail ! (
1142- "cargo build finished with errors for target: {} [{}]" ,
1143- self . main_target,
1144- self . triple
1145- ) ;
1146- }
1139+ Message :: BuildFinished ( finished) if !finished. success => {
1140+ bail ! (
1141+ "cargo build finished with errors for target: {} [{}]" ,
1142+ self . main_target,
1143+ self . triple
1144+ ) ;
11471145 }
11481146 _ => { }
11491147 }
Original file line number Diff line number Diff line change @@ -473,13 +473,11 @@ __wbg_init({{module_or_path: "/{}/{wasm_path}"}}).then((wasm) => {{
473473 ) ;
474474 }
475475 }
476- AssetVariant :: Image ( image_options) => {
477- if image_options. preloaded ( ) {
478- _ = write ! (
479- head_resources,
480- r#"<link rel="preload" as="image" href="/{{base_path}}/assets/{asset_path}" crossorigin>"#
481- ) ;
482- }
476+ AssetVariant :: Image ( image_options) if image_options. preloaded ( ) => {
477+ _ = write ! (
478+ head_resources,
479+ r#"<link rel="preload" as="image" href="/{{base_path}}/assets/{asset_path}" crossorigin>"#
480+ ) ;
483481 }
484482 AssetVariant :: Js ( js_options) => {
485483 if js_options. preloaded ( ) {
Original file line number Diff line number Diff line change @@ -945,15 +945,11 @@ fn wix_version(version: &str) -> Result<String> {
945945 . parse ( )
946946 . with_context ( || format ! ( "Invalid version component: '{part}'" ) ) ?;
947947 match i {
948- 0 | 1 => {
949- if num > 255 {
950- bail ! ( "Version component {part} exceeds maximum value of 255" ) ;
951- }
948+ 0 | 1 if num > 255 => {
949+ bail ! ( "Version component {part} exceeds maximum value of 255" ) ;
952950 }
953- 2 | 3 => {
954- if num > 65535 {
955- bail ! ( "Version component {part} exceeds maximum value of 65535" ) ;
956- }
951+ 2 | 3 if num > 65535 => {
952+ bail ! ( "Version component {part} exceeds maximum value of 65535" ) ;
957953 }
958954 _ => { }
959955 }
Original file line number Diff line number Diff line change @@ -83,12 +83,10 @@ impl RunArgs {
8383 total,
8484 krate,
8585 fresh,
86- } => {
87- if !fresh {
88- tracing:: debug!(
89- "[{bundle_format}] ({current}/{total}) Compiling {krate} " ,
90- )
91- }
86+ } if !fresh => {
87+ tracing:: debug!(
88+ "[{bundle_format}] ({current}/{total}) Compiling {krate} " ,
89+ )
9290 }
9391 BuildStage :: RunningBindgen => {
9492 tracing:: info!( "[{bundle_format}] Running WASM bindgen" )
Original file line number Diff line number Diff line change @@ -872,18 +872,17 @@ impl AppServer {
872872 pid : Option < u32 > ,
873873 ) {
874874 match build_id {
875- BuildId :: PRIMARY => {
875+ BuildId :: PRIMARY
876876 // multiple tabs on web can cause this to be called incorrectly, and it doesn't
877877 // make any sense anyways
878- if self . client . build . bundle != BundleFormat :: Web {
878+ if self . client . build . bundle != BundleFormat :: Web => {
879879 if let Some ( aslr_reference) = aslr_reference {
880880 self . client . aslr_reference = Some ( aslr_reference) ;
881881 }
882882 if let Some ( pid) = pid {
883883 self . client . pid = Some ( pid) ;
884884 }
885885 }
886- }
887886 BuildId :: SECONDARY => {
888887 if let Some ( server) = self . server . as_mut ( ) {
889888 server. aslr_reference = aslr_reference;
@@ -1292,7 +1291,7 @@ impl AppServer {
12921291 . collect ( ) ;
12931292
12941293 // Longer chain = deeper in dep tree = should compile first
1295- crates_with_depth. sort_by ( |a , b| b . 1 . cmp ( & a . 1 ) ) ;
1294+ crates_with_depth. sort_by_key ( | b| std :: cmp:: Reverse ( b . 1 ) ) ;
12961295 crates_with_depth. into_iter ( ) . map ( |( c, _) | c) . collect ( )
12971296 }
12981297
Original file line number Diff line number Diff line change @@ -230,17 +230,16 @@ impl WebServer {
230230 total,
231231 krate,
232232 ..
233- } => {
234- if !matches ! (
235- self . build_status. get( ) ,
236- Status :: Ready | Status :: BuildError { .. }
237- ) {
238- self . build_status . set ( Status :: Building {
239- progress : ( * current as f64 / * total as f64 ) . clamp ( 0.0 , 1.0 ) ,
240- build_message : format ! ( "{krate} compiling" ) ,
241- } ) ;
242- self . send_build_status ( ) . await ;
243- }
233+ } if !matches ! (
234+ self . build_status. get( ) ,
235+ Status :: Ready | Status :: BuildError { .. }
236+ ) =>
237+ {
238+ self . build_status . set ( Status :: Building {
239+ progress : ( * current as f64 / * total as f64 ) . clamp ( 0.0 , 1.0 ) ,
240+ build_message : format ! ( "{krate} compiling" ) ,
241+ } ) ;
242+ self . send_build_status ( ) . await ;
244243 }
245244 BuildStage :: OptimizingWasm => { }
246245 BuildStage :: Aborted => { }
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ pub fn rsx_node_from_html(node: &Node) -> Option<BodyNode> {
9696 // the html-parser crate we use uses a HashMap for attributes. This leads to a
9797 // non-deterministic order of attributes.
9898 // Sort them here
99- attributes. sort_by ( |a, b | a. name . to_string ( ) . cmp ( & b . name . to_string ( ) ) ) ;
99+ attributes. sort_by_key ( |a| a. name . to_string ( ) ) ;
100100
101101 let children = el. children . iter ( ) . filter_map ( rsx_node_from_html) . collect ( ) ;
102102
You can’t perform that action at this time.
0 commit comments