Skip to content

Commit

Permalink
Add Sync bound for set_global_recorder
Browse files Browse the repository at this point in the history
global recorder is shared between threads and must be sync

closes #511
  • Loading branch information
Nekrolm authored Sep 6, 2024
1 parent ca453d3 commit e532160
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics/src/recorder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Drop for LocalRecorderGuard {
/// An error is returned if a recorder has already been set.
pub fn set_global_recorder<R>(recorder: R) -> Result<(), SetRecorderError<R>>
where
R: Recorder + 'static,
R: Recorder + Sync + 'static,
{
GLOBAL_RECORDER.set(recorder)
}
Expand Down

0 comments on commit e532160

Please sign in to comment.