about summary refs log tree commit diff
path: root/library/core/src/str/count.rs
AgeCommit message (Collapse)AuthorLines
2025-07-05use `is_multiple_of` instead of manual moduloFolkert de Vries-1/+1
2025-03-06library: Use size_of from the prelude instead of importedThalia Archibald-1/+1
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2024-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+1
Most modules have such a blank line, but some don't. Inserting the blank line makes it clearer that the `//!` comments are describing the entire module, rather than the `use` declaration(s) that immediately follows.
2024-05-27Always use the general case char countDion Dokter-1/+1
2022-04-15Make some `usize`-typed masks definition agnostic to the size of `usize`Eduardo Sánchez Muñoz-3/+3
Some masks where defined as ```rust const NONASCII_MASK: usize = 0x80808080_80808080u64 as usize; ``` where it was assumed that `usize` is never wider than 64, which is currently true. To make those constants valid in a hypothetical 128-bit target, these constants have been redefined in an `usize`-width-agnostic way ```rust const NONASCII_MASK: usize = usize::from_ne_bytes([0x80; size_of::<usize>()]); ``` There are already some cases where Rust anticipates the possibility of supporting 128-bit targets, such as not implementing `From<usize>` for `u64`.
2022-02-05Fix comment grammar for `do_count_chars`Thom Chiovoloni-1/+1
2022-02-05Respond to review feedback, and improve implementation somewhatThom Chiovoloni-20/+40
2022-02-05Optimize `core::str::Chars::count`Thom Chiovoloni-0/+116