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
biluohc and hawkw committed Mar 3, 2020
1 parent 9eac870 commit d810fbe
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tokio/src/runtime/builder.rs
Expand Up @@ -177,7 +177,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 @@ -189,12 +189,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 @@ -482,7 +482,7 @@ impl fmt::Debug for Builder {
fmt.debug_struct("Builder")
.field("kind", &self.kind)
.field("num_threads", &self.num_threads)
.field("thread_name_fn", &"<dyn Fn()->String+Send+Sync+'static>")
.field("thread_name_fn", &"<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 d810fbe

Please sign in to comment.