Skip to content

Commit

Permalink
Add the static and literal bounds to scope names. This is required by…
Browse files Browse the repository at this point in the history
… tracing, and several other backends require &'static strings
  • Loading branch information
aclysma committed Oct 14, 2024
1 parent c0962e5 commit c69d6ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions profiling/examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ fn some_other_function(iterations: usize) {
burn_time(5);

{
// Make this a non-literal to touch more of the API. It still has to be 'static scope though
// for multiple of the backends
let scope_name = "do_iterations";
profiling::scope!(scope_name);
profiling::scope!("do_iterations");
for i in 0..iterations {
profiling::scope!(
"some_inner_function_that_sleeps",
Expand Down
4 changes: 2 additions & 2 deletions profiling/src/type_check_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

#[macro_export]
macro_rules! scope {
($name:expr) => {
($name:literal) => {
let _: &str = $name;
};
($name:expr, $data:expr) => {
($name:literal, $data:expr) => {
let _: &str = $name;
let _: &str = $data;
};
Expand Down

0 comments on commit c69d6ed

Please sign in to comment.