Skip to content

Commit c4af8d0

Browse files
committed
Impl Update for unit type ()
This is useful in code that uses typestate.
1 parent a1bf3a6 commit c4af8d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/update.rs

+2
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ macro_rules! tuple_impl {
337337
let ($($t,)*) = new_value;
338338
let ($($u,)*) = unsafe { &mut *old_pointer };
339339

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

350351
// Create implementations for tuples up to arity 12
352+
tuple_impl!(;);
351353
tuple_impl!(A; a);
352354
tuple_impl!(A, B; a, b);
353355
tuple_impl!(A, B, C; a, b, c);

0 commit comments

Comments
 (0)