Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1348 +/- ##
=======================================
Coverage 90.04% 90.04%
=======================================
Files 80 80
Lines 15921 15924 +3
=======================================
+ Hits 14336 14339 +3
Misses 1585 1585 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (16.7 MiB → 16.7 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
There was a problem hiding this comment.
Pull request overview
This pull request improves the accuracy of command line length limit calculations by using platform-specific character counting for environment variables on Unix systems. The PR refactors the environment variable size calculation to use a new helper function that properly counts characters for command line execution.
Changes:
- Introduced ARG_HEADROOM constant to replace magic number 2048
- Added count_osstr_chars_for_exec() helper function for accurate character counting
- Refactored environment variable size calculation to use the new helper function
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #[cfg(windows)] | ||
| fn count_osstr_chars_for_exec(s: &OsStr) -> usize { | ||
| use std::os::windows::ffi::OsStrExt; | ||
| // Include +1 for either the null terminator or trailing space. | ||
| s.encode_wide().count() + 1 | ||
| } |
There was a problem hiding this comment.
The Windows implementation of count_osstr_chars_for_exec is defined but never used. This function is only called within the cfg!(unix) block at line 111, which means it will never be called on Windows, leading to dead code. Consider either removing the Windows implementation or adding a Windows-specific env size calculation block that uses this function.
No description provided.