Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
remove push_ctxt and root_ctxt macros
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Feb 11, 2024
1 parent 4c98450 commit dcf2360
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 103 deletions.
75 changes: 0 additions & 75 deletions macros/src/ctxt.rs

This file was deleted.

27 changes: 0 additions & 27 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use proc_macro2::TokenStream;
mod args;
mod build;
mod capture;
mod ctxt;
mod emit;
mod event;
mod filter;
Expand Down Expand Up @@ -248,32 +247,6 @@ pub fn props(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
.unwrap_or_compile_error()
}

#[proc_macro_attribute]
pub fn push_ctxt(
args: proc_macro::TokenStream,
item: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
ctxt::expand_tokens(ctxt::ExpandTokens {
root: false,
input: TokenStream::from(args),
item: TokenStream::from(item),
})
.unwrap_or_compile_error()
}

#[proc_macro_attribute]
pub fn root_ctxt(
args: proc_macro::TokenStream,
item: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
ctxt::expand_tokens(ctxt::ExpandTokens {
root: true,
input: TokenStream::from(args),
item: TokenStream::from(item),
})
.unwrap_or_compile_error()
}

#[proc_macro_attribute]
pub fn fmt(
args: proc_macro::TokenStream,
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke-test/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async fn in_ctxt(a: i32) -> Result<(), io::Error> {
r
}

#[emit::push_ctxt(b, bx: 90)]
#[emit::span("in_ctxt2", b, bx: 90)]
async fn in_ctxt2(b: i32) {
emit::warn!(
"something went wrong at {#[emit::as_debug] id: 42} with {x} and {y: true}!",
Expand Down

0 comments on commit dcf2360

Please sign in to comment.