From 5ec15639b0faf90cc9a9c50f0566133f8f7adcb5 Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Sun, 11 Aug 2024 21:15:14 +0200 Subject: [PATCH] fix: fixed unexpected hidden fields indicators in flatten mode --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/formatting.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 959776ad..fad34d59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -815,7 +815,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hl" -version = "0.29.7" +version = "0.29.8" dependencies = [ "bincode", "byte-strings", diff --git a/Cargo.toml b/Cargo.toml index a40e8238..084814b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [".", "crate/encstr"] [workspace.package] repository = "https://github.com/pamburus/hl" authors = ["Pavel Ivanov "] -version = "0.29.7" +version = "0.29.8" edition = "2021" license = "MIT" diff --git a/src/formatting.rs b/src/formatting.rs index 0c7bda9b..9e9e36ed 100644 --- a/src/formatting.rs +++ b/src/formatting.rs @@ -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())) + }); + } s.batch(|buf| { if item.fields.len() != 0 { buf.push(b' ');