From c2f48ce378ffa0ab090801ea2a0baaec636d116c Mon Sep 17 00:00:00 2001 From: Jonathan Spira <jjspira@gmail.com> Date: Tue, 20 Dec 2022 15:53:03 -0500 Subject: [PATCH] allows for empty `toml::toml!` invocations --- crates/toml/src/macros.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/toml/src/macros.rs b/crates/toml/src/macros.rs index 19b2ce22..b7ce9363 100644 --- a/crates/toml/src/macros.rs +++ b/crates/toml/src/macros.rs @@ -28,10 +28,13 @@ use crate::value::{Array, Table, Value}; /// ``` #[macro_export] macro_rules! toml { - ($($toml:tt)+) => {{ + ($($toml:tt)*) => {{ let table = $crate::value::Table::new(); + + #[allow(unused_mut)] let mut root = $crate::Value::Table(table); - $crate::toml_internal!(@toplevel root [] $($toml)+); + + $crate::toml_internal!(@toplevel root [] $($toml)*); root }}; }