Clean up and use never type

This commit is contained in:
Artemis Tosini 2020-08-08 15:32:50 +00:00
parent 49d7f5e19b
commit 1dc8605807
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
3 changed files with 4 additions and 6 deletions

View file

@ -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<dyn std::error::Error>> {
async fn main() -> Result<!, Box<dyn std::error::Error>> {
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<dyn std::error::Error>> {
drop(sender);
match output::launch(num_tiles, receiver, config.default).await? {}
output::launch(num_tiles, receiver, config.default).await?
}
#[allow(unused)]
fn spawn_stream<E: 'static>(
index: usize,
stream: BoxStream<'static, Result<tile::Block, E>>,

View file

@ -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<E>(
num_tiles: usize,
mut receiver: Receiver<Result<TileData, E>>,
_default: DefaultSection,
) -> io::Result<Infallible>
) -> io::Result<!>
where
E: Send + std::fmt::Debug,
{

View file

@ -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)]