Skip to content

Commit 167c3e0

Browse files
committed
bind span expression to avoid multiple evaluation
1 parent 3b7d7a3 commit 167c3e0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/lro/src/internal/tracing.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,15 @@ macro_rules! record_polling_attributes {
9797
#[cfg(google_cloud_unstable_tracing)]
9898
{
9999
if let Ok(attempt) = $crate::POLL_ATTEMPT_COUNT.try_with(|c| *c) {
100-
$span.record("gcp.longrunning.poll_attempt_count", attempt);
101-
$span.record("gcp.longrunning.done", false);
100+
let span = &$span;
101+
span.record("gcp.longrunning.poll_attempt_count", attempt);
102+
span.record("gcp.longrunning.done", false);
102103
}
103104
}
105+
#[cfg(not(google_cloud_unstable_tracing))]
106+
{
107+
let _ = &$span;
108+
}
104109
};
105110
}
106111

0 commit comments

Comments
 (0)