feat(chain)!: add take convenience method to Append trait

This is useful if the caller wishes to use the type as a staging area.

This is breaking as `Append` has a `Default` bound now.
This commit is contained in:
志宇 committed 2024-06-15 00:52:23 +08:00
1 parent 1eca568be5
commit feb27df180
3 files changed
+17 -12

No files matched your search

+1 -5
View File
@@ -2291,11 +2291,7 @@ impl Wallet {
/// Take the staged [`ChangeSet`] to be persisted now (if any).
pub fn take_staged(&mut self) -> Option<ChangeSet> {
if self.stage.is_empty() {
None
} else {
Some(core::mem::take(&mut self.stage))
}
self.stage.take()
}
/// Get a reference to the inner [`TxGraph`].