Skip to content

Commit

Permalink
address lifetime issue with name
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr committed Jun 28, 2021
1 parent d158451 commit 183d556
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tokio/src/task/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ pub struct Builder<'a> {
name: Option<&'a str>,
}

impl Builder<'_> {
impl<'a> Builder<'a> {
/// Creates a new task builder.
pub fn new() -> Self {
Self::default()
}

/// Assigns a name to the task which will be spawned.
pub fn name<'b>(&self, name: &'b str) -> Builder<'b> {
Builder { name: Some(name) }
pub fn name(&self, name: &'a str) -> Self {
Self { name: Some(name) }
}

/// Spawns a task on the executor.
Expand Down

0 comments on commit 183d556

Please sign in to comment.