Skip to content

Commit

Permalink
Merge pull request #512 from camelid/unit-update
Browse files Browse the repository at this point in the history
Impl `Update` for unit type `()`
  • Loading branch information
nikomatsakis authored Jul 22, 2024
2 parents 0186e66 + c4af8d0 commit 5f35a35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ macro_rules! tuple_impl {
let ($($t,)*) = new_value;
let ($($u,)*) = unsafe { &mut *old_pointer };

#[allow(unused_mut)]
let mut changed = false;
$(
unsafe { changed |= Update::maybe_update($u, $t); }
Expand All @@ -348,6 +349,7 @@ macro_rules! tuple_impl {
}

// Create implementations for tuples up to arity 12
tuple_impl!(;);
tuple_impl!(A; a);
tuple_impl!(A, B; a, b);
tuple_impl!(A, B, C; a, b, c);
Expand Down

0 comments on commit 5f35a35

Please sign in to comment.