From c4af8d01e12039ba514b952137c4a985fe6fd1a3 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Mon, 24 Jun 2024 19:27:26 -0700 Subject: [PATCH] Impl `Update` for unit type `()` This is useful in code that uses typestate. --- src/update.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/update.rs b/src/update.rs index 3313746f..995b72fb 100644 --- a/src/update.rs +++ b/src/update.rs @@ -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);