2 ms·
The documentation is quite clear on this point: > The returned iterator will panic during iteration if any argument to the process is not valid Unicode. If thi
by Hemospectrum 2y ago
The documentation is quite clear on this point:
> The returned iterator will panic during iteration if any argument to the process is not valid Unicode. If this is not desired, use the args_os function instead.
std::env::args_os encodes paths as an OsString, which is allowed to contain invalid Unicode. You can then perform your own Unicode validation as needed, instead of the "ASAP" behavior of std::env::args.
https://doc.rust-lang.org/std/env/fn.args.html https://doc.rust-lang.org/std/env/fn.args.html