fix(remote-ssh): disambiguate NUL escapes in the container stat test - #1901
Merged
bobleer merged 1 commit intoJul 30, 2026
Merged
Conversation
`cargo clippy --all-targets` denied three `clippy::octal_escapes` on the `parse_container_file_output` fixture: the literal separated fields with `\0`, so `\00`, `\01720000000`, and `\0644` read as possible mistaken octal escapes. `\0` is always NUL in Rust, so the values were already what the test intended -- clippy just cannot tell that apart from a typo. Spell the separators `\x00` instead. `\x` consumes exactly two hex digits, so the following digits can no longer be mistaken for part of the escape, and the parsed fields are byte-for-byte unchanged. The lint lives in a `#[cfg(test)]` module, so it only surfaces under `--all-targets`, which is why the Rust Build Check never flagged it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo clippy -p bitfun-services-integrations --features remote-ssh-concrete --all-targetsfailed with three deny-levelclippy::octal_escapeserrors, all on one line in the#[cfg(test)]module ofremote_ssh/manager.rs.The
parse_container_file_outputfixture separated its NUL-delimited fields with\0, which made\00,\01720000000, and\0644look like possibly-mistaken octal escapes.\0is always NUL in Rust, so the parsed values were already what the test intended — clippy simply cannot tell that apart from a typo.The separators are now spelled
\x00. Since\xconsumes exactly two hex digits, the digits that follow can no longer be read as part of the escape.Type and Areas
Type: bug fix (lint failure)
Areas: Rust core (
services-integrations, remote SSH)Motivation / Impact
No direct user-facing change, and no behavior change at all: the string is byte-for-byte identical, so the test asserts on exactly the same parsed entry.
The value is unblocking
--all-targetsclippy. Because the offending literal sits in a#[cfg(test)]module, it is invisible to CI's Rust Build Check, so anyone running the fuller clippy invocation locally hits three hard errors that have nothing to do with their own work. This is pre-existing onmainrather than a regression from recent work.For the record, the field layout is unchanged — 6 NUL-separated fields plus a trailing NUL that
parse_container_file_outputpops:pipe/workspace/pipeo(notd/f/l, which is the point of the test)01720000000644Verification
Both run on this branch, rebased on current
main:cargo clippy -p bitfun-services-integrations --features remote-ssh-concrete --all-targets— exits 0, zerooctal_escapesoccurrences in the output. Two pre-existing warnings remain and are untouched by this PR:unnecessary_unwrapatremote_ssh/manager.rs:3033andfield_reassign_with_defaultatremote_ssh/remote_fs.rs:598.cargo test -p bitfun-services-integrations --lib --features remote-ssh-concrete— 119 passed, 0 failed, 1 ignored, includingcontainer_special_files_are_not_reported_as_regular_files.rustfmt --checkon the touched file — clean.Reviewer Notes
The multi-line wrapping of the call is rustfmt's own output for the longer literal, not a hand-chosen style.
One thing worth flagging separately:
cargo fmt -p bitfun-services-integrationscurrently reformats nine other files in this crate, meaning the crate is not rustfmt-clean onmain. I deliberately kept those out of this PR to keep the diff focused, so this branch touches onlymanager.rs. Happy to open a separate formatting-only PR if that is wanted.Checklist