Skip to content

Commit

Permalink
Add Sync bound for set_global_recorder (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekrolm authored Sep 14, 2024
1 parent ca453d3 commit acd341c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metrics-util/src/layers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl<R> Stack<R> {
}
}

impl<R: Recorder + 'static> Stack<R> {
impl<R: Recorder + Sync + 'static> Stack<R> {
/// Installs this stack as the global recorder.
///
/// An error will be returned if there's an issue with installing the stack as the global recorder.
Expand Down
2 changes: 1 addition & 1 deletion metrics-util/src/recoverable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub struct RecoverableRecorder<R> {
handle: Arc<R>,
}

impl<R: Recorder + 'static> RecoverableRecorder<R> {
impl<R: Recorder + Sync + Send + 'static> RecoverableRecorder<R> {
/// Creates a new `RecoverableRecorder` from the given recorder.
pub fn new(recorder: R) -> Self {
Self { handle: Arc::new(recorder) }
Expand Down
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 acd341c

Please sign in to comment.