Skip to content

Commit

Permalink
Fixed issue with trailing slash on Map Vars
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcmaster committed Oct 27, 2023
1 parent 249f924 commit 4b151c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/config/src/configv2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ impl Display for VarValue<True> {
}
Self::Map(m) => {
write!(f, "{{")?;
let mut multiple_entries = false;
for (k, v) in m.iter() {
if multiple_entries {
// We need to not write a trailing slash, so only add this before the second
write!(f, ",")?;
}
write!(f, "\"{}\": {}", k.escape_default(), v)?;
write!(f, ",")?;
multiple_entries = true;
}
write!(f, "}}")
}
Expand Down

0 comments on commit 4b151c9

Please sign in to comment.