Skip to content

Commit 6641758

Browse files
committed
Don't throw away endpoint after exhausting range
1 parent eed47f3 commit 6641758

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

text/1192-inclusive-ranges.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ more dots means more elements.
2727

2828
```rust
2929
pub enum RangeInclusive<T> {
30-
Empty,
30+
Empty {
31+
at: T,
32+
},
3133
NonEmpty {
3234
start: T,
3335
end: T,
@@ -85,7 +87,7 @@ The `Empty` variant could be omitted, leaving two options:
8587
- `RangeInclusive` could be a struct including a `finished` field.
8688
- `a...b` only implements `IntoIterator`, not `Iterator`, by
8789
converting to a different type that does have the field. However,
88-
this means that `a...b` behaves differently to `a..b`, so
90+
this means that `a.. .b` behaves differently to `a..b`, so
8991
`(a...b).map(|x| ...)` doesn't work (the `..` version of that is
9092
used reasonably often, in the author's experience)
9193
- `a...b` can implement `Iterator` for types that can be stepped

0 commit comments

Comments
 (0)