Skip to content

Commit

Permalink
Filter entries that start with whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Feb 5, 2024
1 parent 9aad030 commit 1a4692c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/history/file_backed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ impl History for FileBackedHistory {
let mut from_file = reader
.lines()
.map(|o| o.map(|i| decode_entry(&i)))
.filter(|e| {
if let Ok(entry) = e {
if entry.starts_with(' ') {
return false;
}
}
true
})
.collect::<std::io::Result<VecDeque<_>>>()?;
if from_file.len() + own_entries.len() > self.capacity {
(
Expand Down

0 comments on commit 1a4692c

Please sign in to comment.