Clean up and use never type
This commit is contained in:
parent
49d7f5e19b
commit
1dc8605807
|
@ -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>>,
|
||||
|
|
|
@ -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,
|
||||
{
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue