forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#100291 - WaffleLapkin:cstr_const_methods, r…
…=oli-obk constify some `CStr` methods This PR marks the following public APIs as `const`: ```rust impl CStr { // feature(const_cstr_from_bytes) pub const fn from_bytes_until_nul(bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError>; pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>; // feature(const_cstr_to_bytes) pub const fn to_bytes(&self) -> &[u8]; pub const fn to_bytes_with_nul(&self) -> &[u8]; pub const fn to_str(&self) -> Result<&str, str::Utf8Error>; } ``` r? `@oli-obk` (use of `const_eval_select` :P ) cc `@mina86` (you've asked for this <3 )
- Loading branch information
Showing
3 changed files
with
37 additions
and
12 deletions.
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