Skip to content

Commit

Permalink
Maybe fix interval logs on Windows (#108)
Browse files Browse the repository at this point in the history
Seems the checked-in test file has `\r\n` line endings on Windows, and
since we consider the encoded histogram as being everything up until the
`\n`, this makes the `\r` part of the encoded, which then makes it
invalid base64!
  • Loading branch information
jonhoo authored Mar 20, 2022
1 parent c56a44e commit 5854b2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/serialization/interval_log/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,8 @@ fn interval_hist(input: &[u8]) -> IResult<&[u8], LogEntry> {
let (input, max) = double(input)?;
let (input, _) = char(',')(input)?;
let (input, encoded_histogram) = map_res(take_until("\n"), str::from_utf8)(input)?;
// Be nice to Windows users:
let encoded_histogram = encoded_histogram.trim_end_matches('\r');
let (input, _) = take(1_usize)(input)?;

Ok((
Expand Down

0 comments on commit 5854b2e

Please sign in to comment.