#osstr #osstring #filename #linux #unix

osstrtools

Additional helper methods for OsStr

11 releases

0.2.2 May 25, 2020
0.2.1 Jan 22, 2020
0.1.9 Jun 16, 2019
0.1.5 May 14, 2019
0.1.4 Apr 27, 2019

#4 in #osstring

Download history 24/week @ 2024-03-14 17/week @ 2024-03-21 49/week @ 2024-03-28 33/week @ 2024-04-04 19/week @ 2024-04-11 19/week @ 2024-04-18 16/week @ 2024-04-25 10/week @ 2024-05-02 16/week @ 2024-05-09 24/week @ 2024-05-16 20/week @ 2024-05-23 13/week @ 2024-05-30 14/week @ 2024-06-06 20/week @ 2024-06-13 25/week @ 2024-06-20 6/week @ 2024-06-27

68 downloads per month
Used in 6 crates (5 directly)

WTFPL license

31KB
547 lines

osstrtools

OsStrTools adds some useful methods to OsStr and OsString that are missing in the standard library, like split(), replace(), or splice(). It is mostly useful for dealing dealing with things like file names, command line arguments, PathBuf, and the like.

Windows support is experimental, but shoud hopefully mostly work, although it is not well tested and likely somewhat slower due to some overhead since it requires checking the strings for correctness. The checking is done by os_str_bytes.

Right now Windows support is still gated behind a feature flag. To enable it add this to your Cargo.toml:

[dependencies]
osstrtools = { version = "0.2", features = ["windows"] }

lib.rs:

OsStrTools

OsStrTools adds some useful methods to OsStr and OsString that are missing in the standard library, like split(), replace(), or splice(). It is mostly useful for dealing dealing with things like file names, command line arguments, PathBuf, and the like.

Windows support is experimental, but shoud hopefully mostly work, although it is not well tested and likely somewhat slower due to some overhead since it requires checking the strings for correctness. The checking is done by os_str_bytes.

This crate is still maintained, but mostly has been deprecated in favor of bstr. If any bugs remain it's likely they will be fixed as they come up, though.

Dependencies

~540KB
~10K SLoC