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

Relax restrictions on writer for tracing_appender::non_blocking::NonBlocking #2607

Merged
merged 2 commits into from
Oct 15, 2023
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 tracing-appender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub(crate) mod sync;
/// });
/// # }
/// ```
pub fn non_blocking<T: Write + Send + Sync + 'static>(writer: T) -> (NonBlocking, WorkerGuard) {
pub fn non_blocking<T: Write + Send + 'static>(writer: T) -> (NonBlocking, WorkerGuard) {
NonBlocking::new(writer)
}

Expand Down
6 changes: 3 additions & 3 deletions tracing-appender/src/non_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ impl NonBlocking {
///
/// [default]: NonBlockingBuilder::default()
/// [builder]: NonBlockingBuilder
pub fn new<T: Write + Send + Sync + 'static>(writer: T) -> (NonBlocking, WorkerGuard) {
pub fn new<T: Write + Send + 'static>(writer: T) -> (NonBlocking, WorkerGuard) {
NonBlockingBuilder::default().finish(writer)
}

fn create<T: Write + Send + Sync + 'static>(
fn create<T: Write + Send + 'static>(
writer: T,
buffered_lines_limit: usize,
is_lossy: bool,
Expand Down Expand Up @@ -221,7 +221,7 @@ impl NonBlockingBuilder {
}

/// Completes the builder, returning the configured `NonBlocking`.
pub fn finish<T: Write + Send + Sync + 'static>(self, writer: T) -> (NonBlocking, WorkerGuard) {
pub fn finish<T: Write + Send + 'static>(self, writer: T) -> (NonBlocking, WorkerGuard) {
NonBlocking::create(
writer,
self.buffered_lines_limit,
Expand Down
4 changes: 2 additions & 2 deletions tracing-appender/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fmt::Debug;
use std::io::Write;
use std::{io, thread};

pub(crate) struct Worker<T: Write + Send + Sync + 'static> {
pub(crate) struct Worker<T: Write + Send + 'static> {
writer: T,
receiver: Receiver<Msg>,
shutdown: Receiver<()>,
Expand All @@ -18,7 +18,7 @@ pub(crate) enum WorkerState {
Shutdown,
}

impl<T: Write + Send + Sync + 'static> Worker<T> {
impl<T: Write + Send + 'static> Worker<T> {
pub(crate) fn new(receiver: Receiver<Msg>, writer: T, shutdown: Receiver<()>) -> Worker<T> {
Self {
writer,
Expand Down
Loading