From 4c0c0cd9f21ec57bb0cc77ee204dae830f78a825 Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Wed, 25 Dec 2024 00:09:16 +0300 Subject: [PATCH] fix buffer not clearing --- src/post/blag.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/post/blag.rs b/src/post/blag.rs index 06007e9..5b6bb6d 100644 --- a/src/post/blag.rs +++ b/src/post/blag.rs @@ -115,6 +115,7 @@ impl Blag { let blag_meta: BlagMetadata = serde_json::from_str(&buf)?; debug!("blag meta: {blag_meta:?}"); let (meta, dont_cache, raw) = blag_meta.into_full(name); + buf.clear(); // this is morally reprehensible if let Some(raw) = raw { @@ -124,10 +125,8 @@ impl Blag { } let parsed = start.elapsed(); - let rendering = Instant::now(); - buf.clear(); reader.read_to_string(&mut buf).await?; let status = cmd.wait().await?;