identifiers: Make device_id! return a reference

Not necessarily 'static like the other macros but otherwise consistent.
This commit is contained in:
Jonas Platte 2021-11-26 16:47:55 +01:00
parent 8923881678
commit c3382f085c
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -92,11 +92,11 @@ where
})
}
/// Shorthand for `Box::<DeviceId>::from`.
/// Shorthand for `<&DeviceId>::from`.
#[macro_export]
macro_rules! device_id {
($s:tt) => {
::std::boxed::Box::<$crate::DeviceId>::from($s)
($s:expr) => {
<&$crate::DeviceId as ::std::convert::From<_>>::from($s)
};
}