diff --git a/lib/core/libimagstore/src/util.rs b/lib/core/libimagstore/src/util.rs index e353d3f4..f09fecd8 100644 --- a/lib/core/libimagstore/src/util.rs +++ b/lib/core/libimagstore/src/util.rs @@ -52,16 +52,12 @@ pub fn entry_buffer_to_header_content(buf: &str) -> Result<(Value, String)> { if line == "---" && !header_consumed { header_consumed = true; // do not further process the line + } else if !header_consumed { + let _ = writeln!(header, "{}", line)?; + } else if iter.peek().is_some() { + let _ = writeln!(content, "{}", line)?; } else { - if !header_consumed { - let _ = writeln!(header, "{}", line)?; - } else { - if iter.peek().is_some() { - let _ = writeln!(content, "{}", line)?; - } else { - let _ = write!(content, "{}", line)?; - } - } + let _ = write!(content, "{}", line)?; } }