From 8e93d7e3631efe5790a482ba8377734701b46a09 Mon Sep 17 00:00:00 2001 From: Skye Jensen Date: Tue, 2 Jun 2020 22:12:11 -0400 Subject: [PATCH] Use Infallible --- src/main.rs | 4 +--- src/output.rs | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index be04065..106dab4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,7 +44,5 @@ async fn main() -> Result<(), Box> { } let num_tiles = tiles.len(); - output::launch(num_tiles, receiver).await?; - - Ok(()) + match output::launch(num_tiles, receiver).await? {} } diff --git a/src/output.rs b/src/output.rs index 35bb1bb..b079fd8 100644 --- a/src/output.rs +++ b/src/output.rs @@ -1,8 +1,9 @@ use crate::tile::TileData; use tokio::io::{self, AsyncWriteExt}; use tokio::sync::mpsc::Receiver; +use std::convert::Infallible; -pub async fn launch(num_tiles: usize, mut receiver: Receiver) -> io::Result<()> { +pub async fn launch(num_tiles: usize, mut receiver: Receiver) -> io::Result { let mut stdout = io::stdout(); stdout.write_all(b"{ \"version\": 1 }\n[").await?;