Replace ruma_identifiers_macros::device_id with ruma_identifiers::device_id
The proc_macro is replaced by a macro_rules macro because it doesn't actually need and proc_macro features.
This commit is contained in:
parent
68d2e088db
commit
0d0480e523
@ -7,16 +7,6 @@ use ruma_identifiers_validation::{
|
||||
};
|
||||
use syn::{parse_macro_input, LitStr};
|
||||
|
||||
#[proc_macro]
|
||||
pub fn device_id(input: TokenStream) -> TokenStream {
|
||||
let id = parse_macro_input!(input as LitStr);
|
||||
let output = quote! {
|
||||
::std::boxed::Box<::ruma::identifiers::DeviceId>::from(#id)
|
||||
};
|
||||
|
||||
output.into()
|
||||
}
|
||||
|
||||
#[proc_macro]
|
||||
pub fn device_key_id(input: TokenStream) -> TokenStream {
|
||||
let id = parse_macro_input!(input as LitStr);
|
||||
|
@ -73,3 +73,11 @@ where
|
||||
T::try_from(&v).map_err(|_| de::Error::invalid_value(Unexpected::Str(&v), &expected_str))
|
||||
})
|
||||
}
|
||||
|
||||
/// Shorthand for `Box::<DeviceId>::from`.
|
||||
#[macro_export]
|
||||
macro_rules! device_id {
|
||||
($s:tt) => {
|
||||
::std::boxed::Box<$crate::DeviceId>::from($s)
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user