Skip to content

Commit

Permalink
chore: remove unused result
Browse files Browse the repository at this point in the history
  • Loading branch information
pepyakin committed Nov 26, 2024
1 parent 9f00583 commit 0a7fe6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions nomt/src/rollback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,20 @@ impl Rollback {
}

/// Dumps the contents of the staging to the rollback.
pub fn writeout_start(&self) -> anyhow::Result<WriteoutData> {
pub fn writeout_start(&self) -> WriteoutData {
let mut in_memory = self.shared.in_memory.lock();
let seglog = self.shared.seglog.lock();

let pending_truncate = in_memory.pending_truncate.take();

// NOTE: for now, if there is a pending truncate, we ignore everything else.
if let Some(pending_truncate) = pending_truncate {
return Ok(WriteoutData {
return WriteoutData {
rollback_start_live: seglog.live_range().0 .0,
rollback_end_live: pending_truncate,
prune_to_new_start_live: None,
prune_to_new_end_live: Some(pending_truncate),
});
};
}

let prune_to_new_start_live = if in_memory.total_len() > self.shared.max_rollback_log_len {
Expand All @@ -224,12 +224,12 @@ impl Rollback {

let (rollback_start_live, rollback_end_live) = seglog.live_range();

Ok(WriteoutData {
WriteoutData {
rollback_start_live: rollback_start_live.0,
rollback_end_live: rollback_end_live.0,
prune_to_new_start_live,
prune_to_new_end_live: None,
})
}
}

/// Finalizes the writeout.
Expand Down
2 changes: 1 addition & 1 deletion nomt/src/store/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn spawn_rollback_writeout_start(
let (result_tx, result_rx) = channel::bounded(1);
let rollback = rollback.clone();
tp.execute(move || {
let writeout_data = rollback.writeout_start().unwrap();
let writeout_data = rollback.writeout_start();
let _ = result_tx.send(writeout_data);
});
Some(result_rx)
Expand Down

0 comments on commit 0a7fe6e

Please sign in to comment.