about summary refs log tree commit diff
path: root/library/core/tests/iter/range.rs
AgeCommit message (Collapse)AuthorLines
2025-01-26Put all coretests in a separate cratebjorn3-504/+0
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-03-14fix unsoundness in Step::forward_unchecked for signed integersThe 8472-0/+5
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-1/+1
2024-02-15Use generic `NonZero` internally.Markus Reiter-2/+2
2024-01-10implement TrustedLen for StepByThe8472-0/+10
2023-08-14Implement Step for AsciiCharltdk-1/+17
2023-03-27replace advance_by returning usize with Result<(), NonZeroUsize>The 8472-9/+10
2023-03-27Change advance(_back)_by to return `usize` instead of `Result<(), usize>`The 8472-9/+9
A successful advance is now signalled by returning `0` and other values now represent the remaining number of steps that couldn't be advanced as opposed to the amount of steps that have been advanced during a partial advance_by. This simplifies adapters a bit, replacing some `match`/`if` with arithmetic. Whether this is beneficial overall depends on whether `advance_by` is mostly used as a building-block for other iterator methods and adapters or whether we also see uses by users where `Result` might be more useful.
2023-01-14Use associated items of `char` instead of freestanding items in `core::char`Lukas Markeffsky-1/+0
2021-11-19Fix Iterator::advance_by contract inconsistencyThe8472-0/+3
The `advance_by(n)` docs state that in the error case `Err(k)` that k is always less than n. It also states that `advance_by(0)` may return `Err(0)` to indicate an exhausted iterator. These statements are inconsistent. Since only one implementation (Skip) actually made use of that I changed it to return Ok(()) in that case too. While adding some tests I also found a bug in `Take::advance_back_by`.
2021-09-30implement advance_(back_)_by on more iteratorsThe8472-0/+23
2021-01-22library/core/tests/iter rearrange & add back missed doc commentsDaniel Conley-0/+13
2021-01-22library/core/test/iter add newlines between testsDaniel Conley-0/+21
2021-01-21library/core/test/iter.rs split attempt 2Daniel Conley-0/+412