Don’t append variable ID if there is only one
This commit is contained in:
@@ -320,7 +320,11 @@ impl foliage::flavor::VariableDeclaration for VariableDeclaration
|
||||
None => unreachable!("all variable IDs should be assigned at this point"),
|
||||
};
|
||||
|
||||
write!(formatter, "{}{}", variable_name_prefix, variable_id + 1)
|
||||
match variable_id
|
||||
{
|
||||
0 => write!(formatter, "{}", variable_name_prefix),
|
||||
_ => write!(formatter, "{}{}", variable_name_prefix, variable_id),
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user