-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
OsStr
methods for stripping and splitting str
prefixes.
* `OsStr::starts_with()` tests whether an `OsStr` has a prefix matching the given `Pattern`. * `OsStr::strip_prefix()` returns the `OsStr` after removing a prefix matching the given `Pattern`. * `OsStr::split_once()` splits an `OsStr` into a `(&str, &OsStr)` pair, where the delimiter matches a given `Pattern`. * `OsStr::starts_with_str()` and `OsStr::strip_prefix_str()` are specialized variants that are implemented more efficiently than the `Pattern` cases. In all cases, the prefix must be Unicode because the current `Pattern` trait is built around the `&str` type.
- Loading branch information
Showing
7 changed files
with
391 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.