@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "conduwuit_macros"
|
||||
name = "tuwunel_macros"
|
||||
categories.workspace = true
|
||||
description.workspace = true
|
||||
edition.workspace = true
|
||||
@@ -10,7 +10,7 @@ repository.workspace = true
|
||||
version.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "conduwuit_macros"
|
||||
name = "tuwunel_macros"
|
||||
path = "mod.rs"
|
||||
proc-macro = true
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::{Result, utils::camel_to_snake_string};
|
||||
|
||||
pub(super) fn command(mut item: ItemFn, _args: &[Meta]) -> Result<TokenStream> {
|
||||
let attr: Attribute = parse_quote! {
|
||||
#[conduwuit_macros::implement(crate::Context, params = "<'_>")]
|
||||
#[tuwunel_macros::implement(crate::Context, params = "<'_>")]
|
||||
};
|
||||
|
||||
item.attrs.push(attr);
|
||||
|
||||
@@ -30,14 +30,14 @@ fn manifest_path(member: Option<&str>) -> Result<PathBuf> {
|
||||
|
||||
let mut path: PathBuf = path.into();
|
||||
|
||||
// conduwuit/src/macros/ -> conduwuit/src/
|
||||
// tuwunel/src/macros/ -> tuwunel/src/
|
||||
path.pop();
|
||||
|
||||
if let Some(member) = member {
|
||||
// conduwuit/$member/Cargo.toml
|
||||
// tuwunel/$member/Cargo.toml
|
||||
path.push(member);
|
||||
} else {
|
||||
// conduwuit/src/ -> conduwuit/
|
||||
// tuwunel/src/ -> tuwunel/
|
||||
path.pop();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ pub(super) fn flags_capture(args: TokenStream) -> TokenStream {
|
||||
let cargo_crate_name = std::env::var("CARGO_CRATE_NAME");
|
||||
let crate_name = match cargo_crate_name.as_ref() {
|
||||
| Err(_) => return args,
|
||||
| Ok(crate_name) => crate_name.trim_start_matches("conduwuit_"),
|
||||
| Ok(crate_name) => crate_name.trim_start_matches("tuwunel_"),
|
||||
};
|
||||
|
||||
let flag = std::env::args().collect::<Vec<_>>();
|
||||
@@ -13,15 +13,15 @@ pub(super) fn flags_capture(args: TokenStream) -> TokenStream {
|
||||
let ret = quote! {
|
||||
pub static RUSTC_FLAGS: [&str; #flag_len] = [#( #flag ),*];
|
||||
|
||||
#[conduwuit_core::ctor]
|
||||
#[tuwunel_core::ctor]
|
||||
fn _set_rustc_flags() {
|
||||
conduwuit_core::info::rustc::FLAGS.lock().expect("locked").insert(#crate_name, &RUSTC_FLAGS);
|
||||
tuwunel_core::info::rustc::FLAGS.lock().expect("locked").insert(#crate_name, &RUSTC_FLAGS);
|
||||
}
|
||||
|
||||
// static strings have to be yanked on module unload
|
||||
#[conduwuit_core::dtor]
|
||||
#[tuwunel_core::dtor]
|
||||
fn _unset_rustc_flags() {
|
||||
conduwuit_core::info::rustc::FLAGS.lock().expect("locked").remove(#crate_name);
|
||||
tuwunel_core::info::rustc::FLAGS.lock().expect("locked").remove(#crate_name);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user