chore: use boxed slice if possible (#6858)

This commit is contained in:
Motoyuki Kimura
2024-09-25 19:45:28 +09:00
committed by GitHub
parent 82628b8a78
commit 09bc9a05e4
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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
@@ -194,7 +194,7 @@ enum WorkerChoice {
}
struct LocalPool {
workers: Vec<LocalWorkerHandle>,
workers: Box<[LocalWorkerHandle]>,
}
impl LocalPool {
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 {