about summary refs log tree commit diff
path: root/tvix/nix-compat/src/wire/bytes_writer.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-08T14·44+0300
committerclbot <clbot@tvl.fyi>2024-04-08T16·51+0000
commitf1496f5722820eeae63edf34daee1c3a95a21df0 (patch)
tree04a88eee58582435ca264df6d2ea8f8481801c04 /tvix/nix-compat/src/wire/bytes_writer.rs
parent24fd4e963a2974cb907a1a68049b21049621efe1 (diff)
refactor(tvix/nix-compat/wire): rename padding_len to total_padding_len r/7879
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 <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
Diffstat (limited to 'tvix/nix-compat/src/wire/bytes_writer.rs')
-rw-r--r--tvix/nix-compat/src/wire/bytes_writer.rs6
1 files changed, 3 insertions, 3 deletions
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