about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/std_example.rs
diff options
context:
space:
mode:
authorThe 8472 <git@infinite-source.de>2021-12-26 03:21:54 +0100
committerThe 8472 <git@infinite-source.de>2023-03-27 14:11:49 +0200
commit69db91b8b25de51633ac9f089cd7fb10a58c2b2a (patch)
tree2bb072195a1a0744f33624b96a1343d12a2452c2 /compiler/rustc_codegen_gcc/example/std_example.rs
parent7a0600714ab1a4cb2d1a88cd0660b9f9a2c07309 (diff)
downloadrust-69db91b8b25de51633ac9f089cd7fb10a58c2b2a.tar.gz
rust-69db91b8b25de51633ac9f089cd7fb10a58c2b2a.zip
Change advance(_back)_by to return `usize` instead of `Result<(), usize>`
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.
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions