From 9c210468fefb1c090d7bb720853baf944dd6d389 Mon Sep 17 00:00:00 2001 From: Skye Date: Sat, 16 Dec 2023 16:58:58 -0500 Subject: [PATCH] Actually do skipping Nones in output --- src/output.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/output.rs b/src/output.rs index f77b97b..090f305 100644 --- a/src/output.rs +++ b/src/output.rs @@ -1,6 +1,6 @@ use crate::tile::{Block, TileData}; use eyre::OptionExt; -use serde::{Serialize, ser::SerializeSeq}; +use serde::{ser::SerializeSeq, Serialize}; use std::sync::Arc; use tokio::{ io::{self, AsyncWriteExt}, @@ -51,7 +51,7 @@ pub async fn run(num_tiles: usize, mut receiver: mpsc::Receiver) -> ey continue; }; *block = Some(message.block); - let mut serialized = serde_json::to_vec(&blocks).unwrap(); + let mut serialized = serde_json::to_vec(&NoneSkipper(&blocks)).unwrap(); serialized.extend_from_slice(b",\n"); stdout.write_all(&serialized).await?; } @@ -77,4 +77,4 @@ where } seq.end() } -} \ No newline at end of file +}