From 5a15a5410083cfc5547692c2f41830d9e1edd530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Medina?= Date: Tue, 10 Dec 2024 13:33:05 -0800 Subject: [PATCH] do not cause warnings when all fields in struct are flattened --- scylla-macros/src/serialize/row.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scylla-macros/src/serialize/row.rs b/scylla-macros/src/serialize/row.rs index 66b841167..e0002c2d0 100644 --- a/scylla-macros/src/serialize/row.rs +++ b/scylla-macros/src/serialize/row.rs @@ -271,19 +271,15 @@ impl Generator for ColumnSortingGenerator<'_> { )?; self.missing.remove(#unflattened_columns); })* - _ => { + _ => 'flatten_try: { #({ match self.#flattened_fields.serialize_field(spec, writer)? { #crate_path::ser::row::FieldStatus::Done => { self.missing.remove(stringify!(#flattened_fields)); - return ::std::result::Result::Ok(if self.missing.is_empty() { - #crate_path::ser::row::FieldStatus::Done - } else { - #crate_path::ser::row::FieldStatus::NotDone - }); + break 'flatten_try; } #crate_path::ser::row::FieldStatus::NotDone => { - return ::std::result::Result::Ok(#crate_path::ser::row::FieldStatus::NotDone) + break 'flatten_try; } #crate_path::ser::row::FieldStatus::NotUsed => {} };