Fix expansion of owned identifier creation macros

This commit is contained in:
Jonas Platte 2023-06-20 11:06:18 +02:00
parent f261f2ebed
commit e71c224308
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C
2 changed files with 21 additions and 19 deletions

View File

@ -141,7 +141,7 @@ macro_rules! event_id {
#[macro_export]
macro_rules! owned_event_id {
($s:literal) => {
$crate::event_id($s).to_owned()
$crate::event_id!($s).to_owned()
};
}
@ -157,7 +157,7 @@ macro_rules! room_alias_id {
#[macro_export]
macro_rules! owned_room_alias_id {
($s:literal) => {
$crate::room_alias_id($s).to_owned()
$crate::room_alias_id!($s).to_owned()
};
}
@ -173,7 +173,7 @@ macro_rules! room_id {
#[macro_export]
macro_rules! owned_room_id {
($s:literal) => {
$crate::room_id($s).to_owned()
$crate::room_id!($s).to_owned()
};
}
@ -197,7 +197,7 @@ macro_rules! server_signing_key_id {
#[macro_export]
macro_rules! owned_server_signing_key_id {
($s:literal) => {
$crate::server_signing_key_id($s).to_owned()
$crate::server_signing_key_id!($s).to_owned()
};
}
@ -213,7 +213,7 @@ macro_rules! server_name {
#[macro_export]
macro_rules! owned_server_name {
($s:literal) => {
$crate::server_name($s).to_owned()
$crate::server_name!($s).to_owned()
};
}
@ -234,7 +234,7 @@ macro_rules! session_id {
#[macro_export]
macro_rules! owned_session_id {
($s:literal) => {
$crate::session_id($s).to_owned()
$crate::session_id!($s).to_owned()
};
}
@ -250,7 +250,7 @@ macro_rules! mxc_uri {
#[macro_export]
macro_rules! owned_mxc_uri {
($s:literal) => {
$crate::mxc_uri($s).to_owned()
$crate::mxc_uri!($s).to_owned()
};
}
@ -266,6 +266,6 @@ macro_rules! user_id {
#[macro_export]
macro_rules! owned_user_id {
($s:literal) => {
$crate::user_id($s).to_owned()
$crate::user_id!($s).to_owned()
};
}

View File

@ -1,13 +1,15 @@
fn main() {
let _ = ruma_common::device_key_id!("ed25519:JLAFKJWSCS");
let _ = ruma_common::event_id!("$39hvsi03hlne:example.com");
let _ = ruma_common::event_id!("$acR1l0raoZnm60CBwAVgqbZqoO/mYU81xysh1u7XcJk");
let _ = ruma_common::mxc_uri!("mxc://myserver.fish/sdfdsfsdfsdfgsdfsd");
let _ = ruma_common::room_alias_id!("#alias:server.tld");
let _ = ruma_common::room_id!("!1234567890:matrix.org");
let _ = ruma_common::room_version_id!("1");
let _ = ruma_common::room_version_id!("1-custom");
let _ = ruma_common::server_signing_key_id!("ed25519:Abc_1");
let _ = ruma_common::server_name!("myserver.fish");
let _ = ruma_common::user_id!("@user:ruma.io");
_ = ruma_common::device_key_id!("ed25519:JLAFKJWSCS");
_ = ruma_common::event_id!("$39hvsi03hlne:example.com");
_ = ruma_common::event_id!("$acR1l0raoZnm60CBwAVgqbZqoO/mYU81xysh1u7XcJk");
_ = ruma_common::mxc_uri!("mxc://myserver.fish/sdfdsfsdfsdfgsdfsd");
_ = ruma_common::room_alias_id!("#alias:server.tld");
_ = ruma_common::room_id!("!1234567890:matrix.org");
_ = ruma_common::room_version_id!("1");
_ = ruma_common::room_version_id!("1-custom");
_ = ruma_common::server_signing_key_id!("ed25519:Abc_1");
_ = ruma_common::server_name!("myserver.fish");
_ = ruma_common::user_id!("@user:ruma.io");
_ = ruma_common::owned_user_id!("@user:ruma.io");
}