Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sync bound for set_global_recorder #513

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send enforced here by Arc

/// 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
Loading