Skip to content

Commit bae024a

Browse files
authored
fix(remote-ssh): disambiguate NUL escapes in the container stat test (#1901)
`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.
1 parent 7970806 commit bae024a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • src/crates/services/services-integrations/src/remote_ssh

src/crates/services/services-integrations/src/remote_ssh/manager.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6034,9 +6034,11 @@ mod tests {
60346034

60356035
#[test]
60366036
fn container_special_files_are_not_reported_as_regular_files() {
6037-
let entry = parse_container_file_output("pipe\0/workspace/pipe\0o\00\01720000000\0644\0")
6038-
.unwrap()
6039-
.unwrap();
6037+
let entry = parse_container_file_output(
6038+
"pipe\x00/workspace/pipe\x00o\x000\x001720000000\x00644\x00",
6039+
)
6040+
.unwrap()
6041+
.unwrap();
60406042

60416043
assert!(!entry.is_file);
60426044
assert!(!entry.is_dir);

0 commit comments

Comments
 (0)