File tree Expand file tree Collapse file tree
llvm_buildbot_monitor/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -960,9 +960,8 @@ impl MessageHandler {
960960 }
961961
962962 fn handle_add_email ( & self , from_uid : UserId , email : Option < & str > ) -> String {
963- let raw_email = match email {
964- Some ( x) => x,
965- None => return "Need an email." . into ( ) ,
963+ let Some ( raw_email) = email else {
964+ return "Need an email." . into ( ) ;
966965 } ;
967966
968967 let email = match Email :: parse ( & remove_zero_width_spaces ( raw_email) ) {
@@ -1009,9 +1008,8 @@ impl MessageHandler {
10091008 }
10101009
10111010 fn handle_remove_email ( & self , from_uid : UserId , email : Option < & str > ) -> String {
1012- let raw_email = match email {
1013- Some ( x) => x,
1014- None => return "Need an email." . into ( ) ,
1011+ let Some ( raw_email) = email else {
1012+ return "Need an email." . into ( ) ;
10151013 } ;
10161014
10171015 let email = match Email :: parse ( & remove_zero_width_spaces ( raw_email) ) {
Original file line number Diff line number Diff line change @@ -407,12 +407,11 @@ async fn fetch_completed_build(
407407 json_get ( client, & format ! ( "green/job/{bot_name}/{id}/api/json" ) ) . await ?;
408408
409409 let mut blamelist = Vec :: new ( ) ;
410- let all_change_sets: Vec < ChangeSetListing > ;
411- if let Some ( x) = data. change_set {
412- all_change_sets = vec ! [ x] ;
410+ let all_change_sets = if let Some ( x) = data. change_set {
411+ vec ! [ x]
413412 } else {
414- all_change_sets = data. change_sets ;
415- }
413+ data. change_sets
414+ } ;
416415 for change_sets in all_change_sets {
417416 for change_set in change_sets. items {
418417 match Email :: parse ( & change_set. author_email ) {
Original file line number Diff line number Diff line change @@ -526,12 +526,12 @@ async fn fetch_build_blamelist(
526526
527527 let mut rs: Vec < Email > = results
528528 . into_iter ( )
529- . filter_map ( |x| match Email :: parse ( remove_name_from_email ( & x. author ) ) {
530- Some ( x) => Some ( x) ,
531- None => {
529+ . filter_map ( |x| {
530+ let Some ( x) = Email :: parse ( remove_name_from_email ( & x. author ) ) else {
532531 warn ! ( "Failed parsing email {:?} -- oh, well." , x. author) ;
533- None
534- }
532+ return None ;
533+ } ;
534+ Some ( x)
535535 } )
536536 . collect ( ) ;
537537
Original file line number Diff line number Diff line change @@ -105,10 +105,10 @@ impl Storage {
105105 let mut result = Vec :: new ( ) ;
106106 for elem in iter {
107107 let elem = elem?;
108- result . push ( match Email :: parse ( & elem) {
109- Some ( x ) => x ,
110- None => bail ! ( "Invalid email address in db: {:?}" , elem ) ,
111- } ) ;
108+ let Some ( x ) = Email :: parse ( & elem) else {
109+ bail ! ( "Invalid email address in db: {:?}" , elem ) ;
110+ } ;
111+ result . push ( x ) ;
112112 }
113113 Ok ( result)
114114 }
You can’t perform that action at this time.
0 commit comments