Remove unnecessary spaces in TRAP output

This commit is contained in:
Nick Rolfe
2021-06-17 16:16:06 +01:00
parent 872c7edfc8
commit ed93233917

View File

@@ -720,9 +720,9 @@ impl fmt::Display for Program {
}
enum TrapEntry {
/// Maps the label to a fresh id, e.g. `#123 = *`.
/// Maps the label to a fresh id, e.g. `#123=*`.
FreshId(Label),
/// Maps the label to a key, e.g. `#7 = @"foo"`.
/// Maps the label to a key, e.g. `#7=@"foo"`.
MapLabelToKey(Label, String),
/// foo_bar(arg*)
GenericTuple(String, Vec<Arg>),
@@ -731,15 +731,15 @@ enum TrapEntry {
impl fmt::Display for TrapEntry {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
TrapEntry::FreshId(label) => write!(f, "{} = *", label),
TrapEntry::FreshId(label) => write!(f, "{}=*", label),
TrapEntry::MapLabelToKey(label, key) => {
write!(f, "{} = @\"{}\"", label, key.replace("\"", "\"\""))
write!(f, "{}=@\"{}\"", label, key.replace("\"", "\"\""))
}
TrapEntry::GenericTuple(name, args) => {
write!(f, "{}(", name)?;
for (index, arg) in args.iter().enumerate() {
if index > 0 {
write!(f, ", ")?;
write!(f, ",")?;
}
write!(f, "{}", arg)?;
}