Skip to content

Commit

Permalink
Improve docs for History::sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Feb 5, 2024
1 parent 192713d commit 0207cf2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/history/file_backed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ impl History for FileBackedHistory {
Ok(())
}

/// Writes unwritten history contents to disk.
/// Syncs current state with disk.
///
/// Normally, that means reading entries from the file and appending new entries to it.
/// If file would exceed `capacity` truncates the oldest entries.
/// If necessary, the whole file is overwritten.
fn sync(&mut self) -> std::io::Result<()> {
if let Some(fname) = &self.file {
if let Some(base_dir) = fname.parent() {
Expand Down

0 comments on commit 0207cf2

Please sign in to comment.