From f1496f5722820eeae63edf34daee1c3a95a21df0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 8 Apr 2024 17:44:28 +0300 Subject: refactor(tvix/nix-compat/wire): rename padding_len to total_padding_len Make it a bit more clear that this is the total padding length, not the padding length we still need to write. Change-Id: I9ff4aa16f256fda367b4b9295abf82ed01b1f989 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11383 Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: picnoir picnoir --- tvix/nix-compat/src/wire/bytes_writer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix/nix-compat/src') diff --git a/tvix/nix-compat/src/wire/bytes_writer.rs b/tvix/nix-compat/src/wire/bytes_writer.rs index 8c391689510d..5941441f44c0 100644 --- a/tvix/nix-compat/src/wire/bytes_writer.rs +++ b/tvix/nix-compat/src/wire/bytes_writer.rs @@ -184,13 +184,13 @@ where } BytesPacketPosition::Padding(pos) => { // Write remaining padding, if there is padding to write. - let padding_len = super::bytes::padding_len(*this.payload_len) as usize; + let total_padding_len = super::bytes::padding_len(*this.payload_len) as usize; - if pos != padding_len { + if pos != total_padding_len { let bytes_written = ensure_nonzero_bytes_written(ready!(this .inner .as_mut() - .poll_write(cx, &EMPTY_BYTES[..padding_len]))?)?; + .poll_write(cx, &EMPTY_BYTES[..total_padding_len]))?)?; *this.state = BytesPacketPosition::Padding(pos + bytes_written); } else { // everything written, break -- cgit 1.4.1