Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
2 people authored and ysl committed Mar 3, 2020
1 parent ba2c9dc commit 2213fce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tokio/src/runtime/builder.rs
Expand Up @@ -219,7 +219,7 @@ impl Builder {
self
}

/// Set the name fn of threads spawned by the `Runtime`'s thread pool.
/// Sets a function used to generate the name of threads spawned by the `Runtime`'s thread pool.
///
/// The default name fn is `|| "tokio-runtime-worker".into()`.
///
Expand All @@ -231,12 +231,12 @@ impl Builder {
///
/// # pub fn main() {
/// let rt = runtime::Builder::new()
/// .thread_name_fn(|| {
/// static ATOMIC_ID: AtomicUsize = AtomicUsize::new(0);
/// let id = ATOMIC_ID.fetch_add(1, Ordering::SeqCst);
/// format!("my-pool-{}", id)
/// })
/// .build();
/// .thread_name_fn(|| {
/// static ATOMIC_ID: AtomicUsize = AtomicUsize::new(0);
/// let id = ATOMIC_ID.fetch_add(1, Ordering::SeqCst);
/// format!("my-pool-{}", id)
/// })
/// .build();
/// # }
/// ```
pub fn thread_name_fn<F>(&mut self, f: F) -> &mut Self
Expand Down Expand Up @@ -543,7 +543,7 @@ impl fmt::Debug for Builder {
.field("kind", &self.kind)
.field("core_threads", &self.core_threads)
.field("max_threads", &self.max_threads)
.field("thread_name", &"<dyn Fn()->String+Send+Sync+'static>")
.field("thread_name", &"<dyn Fn() -> String + Send + Sync + 'static>")
.field("thread_stack_size", &self.thread_stack_size)
.field("after_start", &self.after_start.as_ref().map(|_| "..."))
.field("before_stop", &self.after_start.as_ref().map(|_| "..."))
Expand Down

0 comments on commit 2213fce

Please sign in to comment.