Skip to content

Commit 22d4d99

Browse files
committed
fix typos
1 parent 7af8b48 commit 22d4d99

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

text/3550-new-range.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Rust has several different types of "range" syntax, including the following:
4545
The iterator for `RangeInclusive` will yield values from `a` (inclusive) to `b` (inclusive) in steps of one.
4646

4747
- `a..` denotes a range from `a` (inclusive) with no upper bound. It resolves to the type `std::ops::range::RangeFrom`.
48-
The iterator for `RangeFrom` will yield values starting with `a` and increasing in steps on one.
48+
The iterator for `RangeFrom` will yield values starting with `a` and increasing in steps of one.
4949

5050
These types implement the `IntoIterator` trait, enabling their use directly in a `for` loop:
5151
```rust
@@ -130,9 +130,9 @@ To reduce the need for conversions, we recommend the following:
130130
pub fn takes_range(range: std::ops::Range<usize>) { ... }
131131

132132
// After
133-
pub fn takes_range(range: std::ops::RangeBounds<usize>) { ... }
133+
pub fn takes_range(range: impl std::ops::RangeBounds<usize>) { ... }
134134
// Or
135-
pub fn takes_range(range: impl Into<std::ops::Range<usize>>) { ... }
135+
pub fn takes_range(range: impl Into<std::ops::range::legacy::Range<usize>>) { ... }
136136
```
137137

138138
- Change any trait bounds that assume `Range*: Iterator` to use `IntoIterator` instead
@@ -359,7 +359,9 @@ impl<Idx> TryFrom<range::legacy::RangeInclusive<Idx>> for range::RangeInclusive<
359359
# Drawbacks
360360
[drawbacks]: #drawbacks
361361

362-
This change has the potential to cause a significant amount of churn in the ecosystem. The largest source of this churn will be cases where ranges are assumed to be `Iterator`. While experimenting with implementing the library part of these changes, I
362+
This change has the potential to cause a significant amount of churn in the ecosystem. The largest source of this churn will be cases where ranges are assumed to be `Iterator`. Unlike normal syntax churn, changes will be required to support the new range types, even on older editions.
363+
364+
For example: while experimenting with implementing the library part of these changes, we had to modify [`quote`](https://github.com/pitaj/quote/commit/44feebf0594b255a511ff20890a7acbf4d6aeed1) and [`rustc-rayon`](https://github.com/pitaj/rustc-rayon/commit/e76e554512ce25abb48f4118576ede5d7a457918).
363365

364366
# Rationale and alternatives
365367
[rationale-and-alternatives]: #rationale-and-alternatives

0 commit comments

Comments
 (0)