Skip to content

Commit 451d486

Browse files
committed
style: use std::thread::Result as thread return type
1 parent 0621702 commit 451d486

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/control_thread.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::any::Any;
21
use std::time::Duration;
32

43
use futures::StreamExt;
@@ -14,11 +13,11 @@ use crate::worker_thread::WorkerThread;
1413

1514
pub(crate) struct ControlThread {
1615
shutdown: Shutdown,
17-
threads: FuturesUnordered<NamedTask<Result<(), Box<dyn Any + Send>>>>,
16+
threads: FuturesUnordered<NamedTask<std::thread::Result<()>>>,
1817
}
1918

2019
impl ControlThread {
21-
pub(crate) fn run_in_place(config: Config) -> Result<(), Box<dyn Any + Send>> {
20+
pub(crate) fn run_in_place(config: Config) -> std::thread::Result<()> {
2221
let runtime = tokio::runtime::Builder::new_current_thread()
2322
.enable_all()
2423
.build()
@@ -68,7 +67,7 @@ impl ControlThread {
6867
ControlThread { shutdown, threads }
6968
}
7069

71-
async fn run(mut self) -> Result<(), Box<dyn Any + Send>> {
70+
async fn run(mut self) -> std::thread::Result<()> {
7271
let mut sigterm = tokio::signal::unix::signal(SignalKind::terminate()).unwrap();
7372
let mut sigint = tokio::signal::unix::signal(SignalKind::interrupt()).unwrap();
7473

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod config;
33
mod control_thread;
44
mod worker_thread;
55

6-
fn main() -> Result<(), Box<dyn std::any::Any + Send>> {
6+
fn main() -> std::thread::Result<()> {
77
use clap::{CommandFactory, Parser};
88
use control_thread::ControlThread;
99
use tracing::error;

0 commit comments

Comments
 (0)