Skip to content

Commit

Permalink
Remove unused macro
Browse files Browse the repository at this point in the history
We have now fully replaced the usage of this private macro, remove it.
  • Loading branch information
tcharding committed Feb 1, 2024
1 parent 6d6ee6c commit c0ce672
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
// SPDX-License-Identifier: CC0-1.0

/// Combines the given `$thing` field of two types by setting `self.thing` to be
/// the value in `other.thing` iff `self.thing` is currently empty.
///
/// If `self.thing` already contains a value then this macro does nothing.
#[allow(unused_macros)]
macro_rules! combine {
($thing:ident, $slf:ident, $other:ident) => {
if let (&None, Some($thing)) = (&$slf.$thing, $other.$thing) {
$slf.$thing = Some($thing);
}
};
}

/// Combines two `Option<Foo>` fields.
///
/// Sets `self.thing` to be `Some(other.thing)` iff `self.thing` is `None`.
Expand Down

0 comments on commit c0ce672

Please sign in to comment.