mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-11-25 04:27:52 +00:00
Impl Update
for unit type ()
This is useful in code that uses typestate.
This commit is contained in:
parent
a1bf3a613f
commit
c4af8d01e1
1 changed files with 2 additions and 0 deletions
|
@ -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); }
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue