diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2025-01-07 14:12:07 +0200 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2025-01-07 14:30:02 +0200 |
| commit | bb6bbfa13f97e6ef30ecd63c835c99cf7762bd6e (patch) | |
| tree | 72903e70f117fddc546a875d4fff4285c11c00d1 /library/std/src/sys/pal/windows/process.rs | |
| parent | fb546ee09b226bc4dd4b712d35a372d923c4fa54 (diff) | |
| download | rust-bb6bbfa13f97e6ef30ecd63c835c99cf7762bd6e.tar.gz rust-bb6bbfa13f97e6ef30ecd63c835c99cf7762bd6e.zip | |
Avoid naming variables `str`
This renames variables named `str` to other names, to make sure `str` always refers to a type. It's confusing to read code where `str` (or another standard type name) is used as an identifier. It also produces misleading syntax highlighting.
Diffstat (limited to 'library/std/src/sys/pal/windows/process.rs')
| -rw-r--r-- | library/std/src/sys/pal/windows/process.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/pal/windows/process.rs b/library/std/src/sys/pal/windows/process.rs index 2ca20a21dfe..9332c9b49ff 100644 --- a/library/std/src/sys/pal/windows/process.rs +++ b/library/std/src/sys/pal/windows/process.rs @@ -142,11 +142,11 @@ impl AsRef<OsStr> for EnvKey { } } -pub(crate) fn ensure_no_nuls<T: AsRef<OsStr>>(str: T) -> io::Result<T> { - if str.as_ref().encode_wide().any(|b| b == 0) { +pub(crate) fn ensure_no_nuls<T: AsRef<OsStr>>(s: T) -> io::Result<T> { + if s.as_ref().encode_wide().any(|b| b == 0) { Err(io::const_error!(ErrorKind::InvalidInput, "nul byte found in provided data")) } else { - Ok(str) + Ok(s) } } |
