diff --git a/src/macros.rs b/src/macros.rs index 1e31e53..1bbc707 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -198,7 +198,7 @@ macro_rules! array_serializer { let mut seq = $serializer.serialize_tuple_struct(magic, length)?; for _i in 0..length { - seq.serialize_field(iter.next().ok_or(SerError::custom(error))?.borrow())?; + seq.serialize_field(iter.next().ok_or_else(|| SerError::custom(error))?.borrow())?; } if iter.next().is_some() {