Cargo fmt

This commit is contained in:
Chad Stearns 2020-01-05 16:35:34 -05:00
parent b3bce7b0c4
commit 562f430eef
2 changed files with 43 additions and 34 deletions

View file

@ -538,7 +538,7 @@ pub fn fmt_record<'a>(
buf.push('{');
match _update {
None => {},
None => {}
// We are presuming this to be a Var()
// If it wasnt a Var() we would not have made
// it this far. For example "{ 4 & hello = 9 }"
@ -547,7 +547,7 @@ pub fn fmt_record<'a>(
buf.push(' ');
fmt_expr(buf, &record_var.value, indent, false, false);
buf.push_str(" &");
},
}
}
let is_multiline = loc_fields

View file

@ -523,25 +523,31 @@ mod test_format {
"#
));
expr_formats_to(indoc!(
r#"
{ shoes & rightShoe : nothing }
"#
),indoc!(
r#"
{ shoes & rightShoe: nothing }
"#
));
expr_formats_to(
indoc!(
r#"
{ shoes & rightShoe : nothing }
"#
),
indoc!(
r#"
{ shoes & rightShoe: nothing }
"#
),
);
expr_formats_to(indoc!(
r#"
{ shoes & rightShoe : nothing }
"#
),indoc!(
r#"
{ shoes & rightShoe: nothing }
"#
));
expr_formats_to(
indoc!(
r#"
{ shoes & rightShoe : nothing }
"#
),
indoc!(
r#"
{ shoes & rightShoe: nothing }
"#
),
);
expr_formats_same(indoc!(
r#"
@ -552,20 +558,23 @@ mod test_format {
"#
));
expr_formats_to(indoc!(
r#"
{ shoes
& rightShoe: bareFoot
, leftShoe: bareFoot }
"#
), indoc!(
r#"
{ shoes &
rightShoe: bareFoot,
leftShoe: bareFoot
}
"#
));
expr_formats_to(
indoc!(
r#"
{ shoes
& rightShoe: bareFoot
, leftShoe: bareFoot }
"#
),
indoc!(
r#"
{ shoes &
rightShoe: bareFoot,
leftShoe: bareFoot
}
"#
),
);
}
// #[test]