Skip to content

Commit

Permalink
Remove obsolete conditional compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
mladedav committed Sep 29, 2024
1 parent e0435aa commit 03529a4
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions axum/src/routing/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,31 +911,18 @@ async fn state_isnt_cloned_too_much() {

impl Clone for AppState {
fn clone(&self) -> Self {
#[rustversion::since(1.66)]
#[track_caller]
fn count() {
if SETUP_DONE.load(Ordering::SeqCst) {
let bt = std::backtrace::Backtrace::force_capture();
let bt = bt
.to_string()
.lines()
.filter(|line| line.contains("axum") || line.contains("./src"))
.collect::<Vec<_>>()
.join("\n");
println!("AppState::Clone:\n===============\n{bt}\n");
COUNT.fetch_add(1, Ordering::SeqCst);
}
if SETUP_DONE.load(Ordering::SeqCst) {
let bt = std::backtrace::Backtrace::force_capture();
let bt = bt
.to_string()
.lines()
.filter(|line| line.contains("axum") || line.contains("./src"))
.collect::<Vec<_>>()
.join("\n");
println!("AppState::Clone:\n===============\n{bt}\n");
COUNT.fetch_add(1, Ordering::SeqCst);
}

#[rustversion::not(since(1.66))]
fn count() {
if SETUP_DONE.load(Ordering::SeqCst) {
COUNT.fetch_add(1, Ordering::SeqCst);
}
}

count();

Self
}
}
Expand Down

0 comments on commit 03529a4

Please sign in to comment.