From 1dc8605807c15e111d6c2ab01b9e3e8d2cdd634a Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Sat, 8 Aug 2020 15:32:50 +0000 Subject: [PATCH] Clean up and use never type --- src/main.rs | 6 +++--- src/output.rs | 3 +-- src/tile.rs | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index d962f13..8da3080 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ #![feature(generators)] #![feature(stmt_expr_attributes)] #![feature(proc_macro_hygiene)] +#![feature(never_type)] mod async_iter; mod config; @@ -16,7 +17,7 @@ use std::sync::Arc; use uuid::Uuid; #[tokio::main] -async fn main() -> Result<(), Box> { +async fn main() -> Result> { let config = config::read_config().await?; // We can't do much until we have a D-Bus connection so just do it synchronously @@ -42,10 +43,9 @@ async fn main() -> Result<(), Box> { drop(sender); - match output::launch(num_tiles, receiver, config.default).await? {} + output::launch(num_tiles, receiver, config.default).await? } -#[allow(unused)] fn spawn_stream( index: usize, stream: BoxStream<'static, Result>, diff --git a/src/output.rs b/src/output.rs index 70aebff..260fa8b 100644 --- a/src/output.rs +++ b/src/output.rs @@ -2,14 +2,13 @@ use crate::config::DefaultSection; use crate::tile::TileData; use futures::channel::mpsc::Receiver; use futures::StreamExt; -use std::convert::Infallible; use tokio::io::{self, AsyncWriteExt}; pub async fn launch( num_tiles: usize, mut receiver: Receiver>, _default: DefaultSection, -) -> io::Result +) -> io::Result where E: Send + std::fmt::Debug, { diff --git a/src/tile.rs b/src/tile.rs index 1540658..2f0a23e 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -4,7 +4,6 @@ use std::fmt::Debug; use std::sync::Arc; #[cfg(feature = "check_latency")] use std::time::Instant; -//use tokio::sync::mpsc::{error::SendError, Sender}; #[allow(unused)] #[derive(Copy, Clone, Debug, Serialize)]