From 77738fd6466ac69504fb23baab4de3d3fa4e624e Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Wed, 4 Jun 2025 00:50:21 +0200 Subject: [PATCH] Remove obsolete comments If arguments always have the same value they do not need to be arguments. For `HistoryImpl::add`, the comments are incorrect (assuming they should indicate the value of the argument), since both arguments can be true or false independently. `History::add` is only called at one location in a test with a constant value of `false` for `pending`. This might mean that the parameter could be deleted, or maybe even the entire function, if testing can work without it. --- src/history.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/history.rs b/src/history.rs index d180f0164..a1ca59c25 100644 --- a/src/history.rs +++ b/src/history.rs @@ -395,12 +395,7 @@ fn history_file_path(&self) -> std::io::Result> { /// `item_at_index()` until a call to `resolve_pending()`. Pending items are tracked with an /// offset into the array of new items, so adding a non-pending item has the effect of resolving /// all pending items. - fn add( - &mut self, - item: HistoryItem, - pending: bool, /*=false*/ - do_save: bool, /*=true*/ - ) { + fn add(&mut self, item: HistoryItem, pending: bool, do_save: bool) { // We use empty items as sentinels to indicate the end of history. // Do not allow them to be added (#6032). if item.contents.is_empty() { @@ -1283,7 +1278,7 @@ fn imp(&self) -> MutexGuard { /// Privately add an item. If pending, the item will not be returned by history searches until a /// call to resolve_pending. Any trailing ephemeral items are dropped. /// Exposed for testing. - pub fn add(&self, item: HistoryItem, pending: bool /*=false*/) { + pub fn add(&self, item: HistoryItem, pending: bool) { self.imp().add(item, pending, true) }