Skip to content

Commit

Permalink
fix: fixed unexpected hidden fields indicators in flatten mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus committed Aug 11, 2024
1 parent b71d753 commit 5ec1563
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = [".", "crate/encstr"]
[workspace.package]
repository = "https://github.com/pamburus/hl"
authors = ["Pavel Ivanov <[email protected]>"]
version = "0.29.7"
version = "0.29.8"
edition = "2021"
license = "MIT"

Expand Down
10 changes: 5 additions & 5 deletions src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,12 @@ impl<'a> FieldFormatter<'a> {
for (k, v) in item.fields.iter() {
some_fields_hidden |= !self.format(s, k, *v, fs, filter, setting);
}
if some_fields_hidden {
s.element(Element::Ellipsis, |s| {
s.batch(|buf| buf.extend(self.rf.cfg.punctuation.hidden_fields_indicator.as_bytes()))
});
}
if !fs.flatten {
if some_fields_hidden {
s.element(Element::Ellipsis, |s| {
s.batch(|buf| buf.extend(self.rf.cfg.punctuation.hidden_fields_indicator.as_bytes()))
});

Check warning on line 443 in src/formatting.rs

View check run for this annotation

Codecov / codecov/patch

src/formatting.rs#L441-L443

Added lines #L441 - L443 were not covered by tests
}
s.batch(|buf| {
if item.fields.len() != 0 {
buf.push(b' ');
Expand Down

0 comments on commit 5ec1563

Please sign in to comment.