rust/library/std/src
Matthias Krüger f337e28bd9
Rollup merge of #147773 - timvisee:docs-empty-is-ascii, r=Noratrieb
`is_ascii` on an empty string or slice returns true

Update the description of the [`is_ascii`](https://doc.rust-lang.org/std/primitive.str.html#method.is_ascii) functions - an empty string or slice also returns `true`.

This follows the pattern of [`all()`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.all). Clippy currently suggests to change `string.chars().all(|c| c.is_ascii())` into `string.is_ascii()`. This suggestion therefore seems fitting.

I've already questioned the behavior for this multiple times. I've always had to check the internals to conclude how it works. That's why I'm opening this PR to add it directly in the documentation.
2025-10-16 19:35:28 +02:00
..
backtrace remove redundant imports 2023-12-10 10:56:22 +08:00
collections remove deprecated Error::description in impls 2025-08-26 06:36:53 +00:00
ffi is_ascii on an empty string or slice returns true 2025-10-16 10:52:51 +02:00
fs feat(std): emulate flock for solaris via fcntl 2025-09-07 00:05:13 -04:00
hash remove const_hash feature leftovers 2024-11-02 11:27:14 +01:00
io Fix typo 2025-09-28 00:51:57 +02:00
net Rollup merge of #146937 - joboet:gethostname, r=Mark-Simulacrum 2025-09-29 21:42:41 +02:00
num Rollup merge of #146451 - DimitriiTrater:atan2_correctness_docs, r=tgross35 2025-10-04 17:11:09 +02:00
os Add Motor OS std library port 2025-10-08 08:57:58 -07:00
prelude Make derive_const usable within libcore again 2025-07-17 15:42:54 +00:00
process Fix test suite in iOS/tvOS/watchOS/visionOS simulator 2025-09-19 13:55:03 +02:00
sync Rollup merge of #143191 - connortsui20:stabilize-rwlock-downgrade, r=tgross35 2025-10-15 23:41:00 +02:00
sys Rollup merge of #147000 - moturus:motor-os_stdlib_pr, r=tgross35 2025-10-16 19:35:23 +02:00
sys_common Move WTF-8 code from std to core/alloc 2025-08-20 20:31:33 -04:00
thread Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, r=Mark-Simulacrum 2025-10-02 10:27:48 +02:00
alloc.rs Support #[alloc_error_handler] without the allocator shim 2025-10-10 13:04:53 +00:00
ascii.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
backtrace.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
bstr.rs Implement ByteStr and ByteString types 2025-01-11 06:35:21 +02:00
env.rs std: add support for armv7a-vex-v5 target 2025-09-24 12:10:15 -05:00
error.rs Move std::error unit tests to integration tests 2025-01-26 10:28:04 +00:00
fs.rs Rollup merge of #144964 - 0xdeafbeef:fix-open-options, r=ibraheemdev 2025-08-30 18:49:48 -05:00
keyword_docs.rs Document fully-qualified syntax in as' keyword doc 2025-10-03 17:31:55 +03:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs fix missing link to std::char in std docs 2025-10-14 10:23:29 +02:00
macros.rs feat: implement hash_map! macro 2025-08-02 01:32:52 +02:00
panic.rs Update CURRENT_RUSTC_VERSION post-bump 2025-09-26 18:41:32 -04:00
panicking.rs Change the cfg to a dash 2025-09-21 13:12:20 -04:00
pat.rs Add pattern types to parser 2024-04-08 11:57:17 +00:00
path.rs Rollup merge of #142506 - clarfonthey:path-trailing-sep, r=joboet 2025-09-30 20:46:44 +02:00
process.rs std: merge definitions of StdioPipes 2025-09-21 19:45:46 +02:00
random.rs random: Provide a Distribution<T> trait 2025-07-11 10:21:34 -07:00
rt.rs Change the cfg to a dash 2025-09-21 13:12:20 -04:00
test_helpers.rs std: get rid of sys_common::io 2025-02-07 16:54:07 +01:00
time.rs Fix documentation of Instant::now on mac 2025-10-10 20:01:03 +01:00