Tidy up some match bindings to be more consistent with the rest of the codebase.

This commit is contained in:
Dan Gohman
2018-12-11 13:22:28 -08:00
parent c8e457e834
commit 8bd35e154b
3 changed files with 11 additions and 10 deletions

View File

@@ -122,7 +122,7 @@ impl Formatter {
pub fn add_match(&mut self, m: Match) {
self.line(&format!("match {} {{", m.expr));
self.indent(|fmt| {
for ((fields, body), names) in m.arms.iter() {
for (&(ref fields, ref body), ref names) in m.arms.iter() {
// name { fields } | name { fields } => { body }
let conditions: Vec<String> = names
.iter()
@@ -252,7 +252,7 @@ mod srcgen_tests {
use super::Formatter;
use super::Match;
fn from_raw_string(s: impl Into<String>) -> Vec<String> {
fn from_raw_string<S: Into<String>>(s: S) -> Vec<String> {
s.into()
.trim()
.split("\n")