about summary refs log tree commit diff
path: root/library/core/src/array/ascii.rs
AgeCommit message (Collapse)AuthorLines
2025-03-06Remove #[cfg(not(test))] gates in coreThalia Archibald-1/+0
These gates are unnecessary now that unit tests for `core` are in a separate package, `coretests`, instead of in the same files as the source code. They previously prevented the two `core` versions from conflicting with each other.
2024-10-12Stabilize `const_option`Trevor Gross-1/+0
This makes the following API stable in const contexts: impl<T> Option<T> { pub const fn as_mut(&mut self) -> Option<&mut T>; pub const fn expect(self, msg: &str) -> T; pub const fn unwrap(self) -> T; pub const unsafe fn unwrap_unchecked(self) -> T; pub const fn take(&mut self) -> Option<T>; pub const fn replace(&mut self, value: T) -> Option<T>; } impl<T> Option<&T> { pub const fn copied(self) -> Option<T> where T: Copy; } impl<T> Option<&mut T> { pub const fn copied(self) -> Option<T> where T: Copy; } impl<T, E> Option<Result<T, E>> { pub const fn transpose(self) -> Result<Option<T>, E> } impl<T> Option<Option<T>> { pub const fn flatten(self) -> Option<T>; } The following functions make use of the unstable `const_precise_live_drops` feature: - `expect` - `unwrap` - `unwrap_unchecked` - `transpose` - `flatten` Fixes: <https://github.com/rust-lang/rust/issues/67441>
2024-07-26Fix doc nitsJohn Arundel-2/+2
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2023-05-04Add an example that depends on `is_ascii` in a `const`Scott McMurray-0/+13
2023-05-04Constify `[u8]::is_ascii` (unstably)Scott McMurray-1/+1
UTF-8 checking in `const fn`-stabilized back in 1.63, but apparently somehow ASCII checking was never const-ified, despite being simpler.
2023-05-03Add the basic `ascii::Char` typeScott McMurray-0/+34