Skip to content

Commit

Permalink
chore: use boxed slice if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
mox692 committed Sep 21, 2024
1 parent b5de84d commit ec5a0af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tokio-util/src/task/spawn_pinned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tokio::task::{spawn_local, JoinHandle, LocalSet};
/// Internally the local pool uses a [`tokio::task::LocalSet`] for each worker thread
/// in the pool. Consequently you can also use [`tokio::task::spawn_local`] (which will
/// execute on the same thread) inside the Future you supply to the various spawn methods
/// of `LocalPoolHandle`,
/// of `LocalPoolHandle`.
///
/// [`tokio::task::LocalSet`]: tokio::task::LocalSet
/// [`tokio::task::spawn_local`]: tokio::task::spawn_local
Expand Down Expand Up @@ -194,7 +194,7 @@ enum WorkerChoice {
}

struct LocalPool {
workers: Vec<LocalWorkerHandle>,
workers: Box<[LocalWorkerHandle]>,
}

impl LocalPool {
Expand Down
2 changes: 1 addition & 1 deletion tokio-util/src/time/wheel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub(crate) struct Wheel<T> {
/// * ~ 4 min slots / ~ 4 hr range
/// * ~ 4 hr slots / ~ 12 day range
/// * ~ 12 day slots / ~ 2 yr range
levels: Vec<Level<T>>,
levels: Box<[Level<T>]>,
}

/// Number of levels. Each level has 64 slots. By using 6 levels with 64 slots
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/signal/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Once;
use std::task::{Context, Poll};

pub(crate) type OsStorage = Vec<SignalInfo>;
pub(crate) type OsStorage = Box<[SignalInfo]>;

impl Init for OsStorage {
fn init() -> Self {
Expand Down

0 comments on commit ec5a0af

Please sign in to comment.