mirror of
https://gitee.com/openharmony/third_party_rust_log
synced 2024-11-23 07:40:08 +00:00
run fmt
This commit is contained in:
parent
d6e44eb253
commit
7ed6401b93
@ -40,34 +40,44 @@ impl<'v> ToValue for Value<'v> {
|
|||||||
/// Get a value from a type implementing `std::fmt::Debug`.
|
/// Get a value from a type implementing `std::fmt::Debug`.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! as_debug {
|
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`.
|
/// Get a value from a type implementing `std::fmt::Display`.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! as_display {
|
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.
|
/// Get a value from an error.
|
||||||
#[cfg(feature = "kv_unstable_std")]
|
#[cfg(feature = "kv_unstable_std")]
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! as_error {
|
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")]
|
#[cfg(feature = "kv_unstable_serde")]
|
||||||
/// Get a value from a type implementing `serde::Serialize`.
|
/// Get a value from a type implementing `serde::Serialize`.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! as_serde {
|
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`.
|
/// Get a value from a type implementing `sval::value::Value`.
|
||||||
#[cfg(feature = "kv_unstable_sval")]
|
#[cfg(feature = "kv_unstable_sval")]
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! as_sval {
|
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.
|
/// A value in a structured key-value pair.
|
||||||
|
Loading…
Reference in New Issue
Block a user