From d8a6cc862dadd2f49548561290bae5b5722f86f3 Mon Sep 17 00:00:00 2001 From: edef Date: Wed, 8 May 2024 00:58:36 +0000 Subject: refactor(nix-compat/wire/bytes/reader): drop prev_filled We specifically structured the code this way to allow using `this.filled` as-is, so we should use it. Change-Id: I7e11bddceb4d5f37b1dd4c453a9d53b85fc1f6c8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11602 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/nix-compat/src/wire/bytes/reader/trailer.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tvix/nix-compat') diff --git a/tvix/nix-compat/src/wire/bytes/reader/trailer.rs b/tvix/nix-compat/src/wire/bytes/reader/trailer.rs index 0b0c7b13554d..82aa2a228095 100644 --- a/tvix/nix-compat/src/wire/bytes/reader/trailer.rs +++ b/tvix/nix-compat/src/wire/bytes/reader/trailer.rs @@ -124,10 +124,9 @@ impl Future for ReadTrailer { ready!(Pin::new(&mut this.reader).poll_read(cx, &mut buf))?; this.filled = { - let prev_filled = this.filled; let filled = buf.filled().len() as u8; - if filled == prev_filled { + if filled == this.filled { return Err(io::ErrorKind::UnexpectedEof.into()).into(); } -- cgit 1.4.1