Skip to content

Commit

Permalink
Fix compile time error
Browse files Browse the repository at this point in the history
  • Loading branch information
chinedufn committed Jan 25, 2025
1 parent 8f8c103 commit 2cfdae6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tokio/src/runtime/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ impl Handle {
/// println!("Current runtime id: {}", Handle::current().id());
/// }
/// ```
///
/// [`Id`]: crate::runtime::Id
pub fn id(&self) -> crate::runtime::Id {
let owned_id = match &self.inner {
scheduler::Handle::CurrentThread(handle) => handle.owned_id(),
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/task/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ cfg_unstable! {
/// [unstable]: crate#unstable-features
/// [`Id`]: struct@crate::runtime::Id
pub fn id(&self) -> runtime::Id {
self.context.shared.local_state.owned.id.into()
runtime::Id::new(self.context.shared.local_state.owned.id)
}
}
}
Expand Down

0 comments on commit 2cfdae6

Please sign in to comment.