#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

#5 in #osstring

Download history 2/week @ 2023-12-04 7/week @ 2023-12-11 14/week @ 2023-12-18 7/week @ 2023-12-25 19/week @ 2024-01-01 24/week @ 2024-01-08 10/week @ 2024-01-15 10/week @ 2024-01-29 8/week @ 2024-02-05 128/week @ 2024-02-12 8/week @ 2024-02-19 55/week @ 2024-02-26 32/week @ 2024-03-04 32/week @ 2024-03-11 22/week @ 2024-03-18

141 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

~520KB