diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-03-22 13:36:56 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-03-30 10:52:29 +0200 |
| commit | 9bba047c2e425fce03b039bcb8ccd60ddcbc80a0 (patch) | |
| tree | 955fb13c65c6a29f4ad8535485f91c2c77b7233b /src/librustc_mir/dataflow/framework | |
| parent | 8926bb497d9b127eb318aea5aed0e745d8381591 (diff) | |
Use if let instead of match when only matching a single variant (clippy::single_match)
Makes code more compact and reduces nestig.
Diffstat (limited to 'src/librustc_mir/dataflow/framework')
| -rw-r--r-- | src/librustc_mir/dataflow/framework/graphviz.rs | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/librustc_mir/dataflow/framework/graphviz.rs b/src/librustc_mir/dataflow/framework/graphviz.rs index a85c428d3bf..bdd41121359 100644 --- a/src/librustc_mir/dataflow/framework/graphviz.rs +++ b/src/librustc_mir/dataflow/framework/graphviz.rs @@ -229,26 +229,22 @@ where } // Write any changes caused by terminator-specific effects - match terminator.kind { - mir::TerminatorKind::Call { destination: Some(_), .. } => { - let num_state_columns = self.num_state_columns(); - self.write_row(w, "", "(on successful return)", |this, w, fmt| { - write!( - w, - r#"<td balign="left" colspan="{colspan}" {fmt} align="left">"#, - colspan = num_state_columns, - fmt = fmt, - )?; - - let state_on_unwind = this.results.get().clone(); - this.results.seek_after_assume_success(terminator_loc); - write_diff(w, this.results.analysis(), &state_on_unwind, this.results.get())?; - - write!(w, "</td>") - })?; - } - - _ => {} + if let mir::TerminatorKind::Call { destination: Some(_), .. } = terminator.kind { + let num_state_columns = self.num_state_columns(); + self.write_row(w, "", "(on successful return)", |this, w, fmt| { + write!( + w, + r#"<td balign="left" colspan="{colspan}" {fmt} align="left">"#, + colspan = num_state_columns, + fmt = fmt, + )?; + + let state_on_unwind = this.results.get().clone(); + this.results.seek_after_assume_success(terminator_loc); + write_diff(w, this.results.analysis(), &state_on_unwind, this.results.get())?; + + write!(w, "</td>") + })?; }; write!(w, "</table>") |
