From 7ed6401b93dd151273859e57b15f96e716f31069 Mon Sep 17 00:00:00 2001 From: KodrAus Date: Sun, 12 Dec 2021 11:13:26 +1000 Subject: [PATCH] run fmt --- src/kv/value.rs | 20 +++++++++++++++----- tests/macros.rs | 14 +++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/kv/value.rs b/src/kv/value.rs index 727c249..c349b8c 100644 --- a/src/kv/value.rs +++ b/src/kv/value.rs @@ -40,34 +40,44 @@ impl<'v> ToValue for Value<'v> { /// Get a value from a type implementing `std::fmt::Debug`. #[macro_export] macro_rules! as_debug { - ($capture:expr) => ($crate::kv::Value::from_debug(&$capture)); + ($capture:expr) => { + $crate::kv::Value::from_debug(&$capture) + }; } /// Get a value from a type implementing `std::fmt::Display`. #[macro_export] macro_rules! as_display { - ($capture:expr) => ($crate::kv::Value::from_display(&$capture)); + ($capture:expr) => { + $crate::kv::Value::from_display(&$capture) + }; } /// Get a value from an error. #[cfg(feature = "kv_unstable_std")] #[macro_export] macro_rules! as_error { - ($capture:expr) => ($crate::kv::Value::from_dyn_error(&$capture)); + ($capture:expr) => { + $crate::kv::Value::from_dyn_error(&$capture) + }; } #[cfg(feature = "kv_unstable_serde")] /// Get a value from a type implementing `serde::Serialize`. #[macro_export] macro_rules! as_serde { - ($capture:expr) => ($crate::kv::Value::from_serde(&$capture)); + ($capture:expr) => { + $crate::kv::Value::from_serde(&$capture) + }; } /// Get a value from a type implementing `sval::value::Value`. #[cfg(feature = "kv_unstable_sval")] #[macro_export] macro_rules! as_sval { - ($capture:expr) => ($crate::kv::Value::from_sval(&$capture)); + ($capture:expr) => { + $crate::kv::Value::from_sval(&$capture) + }; } /// A value in a structured key-value pair. diff --git a/tests/macros.rs b/tests/macros.rs index 56dbbf2..3b4dbd3 100644 --- a/tests/macros.rs +++ b/tests/macros.rs @@ -190,27 +190,27 @@ mod implicit_args { #[test] fn implicit_named_args() { let world = "world"; - + for lvl in log::Level::iter() { log!(lvl, "hello {world}"); log!(lvl, "hello {world}",); - + log!(target: "my_target", lvl, "hello {world}"); log!(target: "my_target", lvl, "hello {world}",); - + log!(lvl; "hello {world}"); log!(lvl; "hello {world}",); - + log!(target = "my_target", lvl; "hello {world}"); log!(target = "my_target", lvl; "hello {world}",); } - + all_log_macros!("hello {world}"); all_log_macros!("hello {world}",); - + all_log_macros!(target = "my_target"; "hello {world}"); all_log_macros!(target = "my_target"; "hello {world}",); - + all_log_macros!(target: "my_target", "hello {world}"); all_log_macros!(target: "my_target", "hello {world}",); }