Skip to content

Commit 5b0e364

Browse files
committed
Cleanup trailing whitespace
1 parent ef301ca commit 5b0e364

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

text/3550-new-range.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ Another primary motivation is the extra size of `RangeInclusive`. It uses an ext
3838

3939
Rust has several different types of "range" syntax, including the following:
4040

41-
- `a..b` denotes a range from `a` (inclusive) to `b` (exclusive). It resolves to the type `std::range::Range`.
41+
- `a..b` denotes a range from `a` (inclusive) to `b` (exclusive). It resolves to the type `std::range::Range`.
4242
The iterator for `Range` will yield values from `a` (inclusive) to `b` (exclusive) in steps of one.
4343

4444
- `a..=b` denotes a range from `a` (inclusive) to `b` (inclusive). It resolve to the type `std::range::RangeInclusive`.
4545
The iterator for `RangeInclusive` will yield values from `a` (inclusive) to `b` (inclusive) in steps of one.
4646

47-
- `a..` denotes a range from `a` (inclusive) with no upper bound. It resolves to the type `std::range::RangeFrom`.
47+
- `a..` denotes a range from `a` (inclusive) with no upper bound. It resolves to the type `std::range::RangeFrom`.
4848
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:
@@ -151,7 +151,7 @@ Some libraries have range types in their public interface. To use the new range
151151

152152
To reduce the burden of explicit conversions, libraries should make the following backwards-compatible changes:
153153

154-
- Change any function parameters from legacy `Range*` types to `impl Into<Range*>`
154+
- Change any function parameters from legacy `Range*` types to `impl Into<Range*>`
155155
Or if applicable, `impl RangeBounds<_>`
156156

157157
```rust
@@ -164,7 +164,7 @@ pub fn takes_range(range: impl Into<std::range::legacy::Range<usize>>) { ... }
164164
pub fn takes_range(range: impl std::ops::RangeBounds<usize>) { ... }
165165
```
166166

167-
- Change any trait bounds that assume `Range*: Iterator` to use `IntoIterator` instead
167+
- Change any trait bounds that assume `Range*: Iterator` to use `IntoIterator` instead
168168
This is fully backwards-compatible, thanks to the [blanket `impl<I: Iterator> IntoIterator for I`](https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html#impl-IntoIterator-for-I)
169169

170170
```rust
@@ -242,7 +242,7 @@ The [**Range Expressions** page in the Reference](https://doc.rust-lang.org/refe
242242
> ## Edition 2024 and later
243243
>
244244
> The `..` and `..=` operators will construct an object of one of the `std::range::Range` (or `core::range::Range`) variants, according to the following table:
245-
>
245+
>
246246
> | Production | Syntax | Type | Range |
247247
> |------------------------|---------------|------------------------------|-----------------------|
248248
> | _RangeExpr_ | start`..`end | std::range::Range | start &le; x &lt; end |
@@ -251,11 +251,11 @@ The [**Range Expressions** page in the Reference](https://doc.rust-lang.org/refe
251251
> | _RangeFullExpr_ | `..` | std::range::RangeFull | - |
252252
> | _RangeInclusiveExpr_ | start`..=`end | std::range::RangeInclusive | start &le; x &le; end |
253253
> | _RangeToInclusiveExpr_ | `..=`end | std::range::RangeToInclusive | x &le; end |
254-
>
254+
>
255255
> **Note:** While `std::ops::RangeTo`, `std::ops::RangeFull`, and `std::ops::RangeToInclusive` are re-exports of `std::range::RangeTo`, `std::range::RangeFull`, and `std::ops::Range::RangeToInclusive` respectively, `std::ops::Range`, `std::ops::RangeFrom`, and `std::ops::RangeInclusive` are re-exports of the types under `std::range::legacy::` (NOT those directly under `std::range::`) for backwards-compatibility reasons.
256-
>
256+
>
257257
> Examples:
258-
>
258+
>
259259
> ```rust
260260
> 1..2; // std::range::Range
261261
> 3..; // std::range::RangeFrom
@@ -266,18 +266,18 @@ The [**Range Expressions** page in the Reference](https://doc.rust-lang.org/refe
266266
> ```
267267
>
268268
> The following expressions are equivalent.
269-
>
269+
>
270270
> ```rust
271271
> let x = std::range::Range {start: 0, end: 10};
272272
> let y = 0..10;
273-
>
273+
>
274274
> assert_eq!(x, y);
275275
> ```
276276
>
277277
> ## Prior to Edition 2024
278278
>
279279
> The `..` and `..=` operators will construct an object of one of the `std::range::legacy::Range` (or `core::range::legacy::Range`) variants, according to the following table:
280-
>
280+
>
281281
> | Production | Syntax | Type | Range |
282282
> |------------------------|---------------|------------------------------|-----------------------|
283283
> | _RangeExpr_ | start`..`end | std::range::legacy::Range | start &le; x &lt; end |
@@ -290,7 +290,7 @@ The [**Range Expressions** page in the Reference](https://doc.rust-lang.org/refe
290290
> **Note:** `std::ops::Range`, `std::ops::RangeFrom`, and `std::ops::RangeInclusive` are re-exports of the respective types under `std::range::legacy::`. `std::ops::RangeTo`, `std::ops::RangeFull`, and `std::ops::RangeToInclusive` are re-exports of the respective types under `std::range::`.
291291
>
292292
> Examples:
293-
>
293+
>
294294
> ```rust
295295
> 1..2; // std::range::legacy::Range
296296
> 3..; // std::range::legacy::RangeFrom
@@ -299,14 +299,14 @@ The [**Range Expressions** page in the Reference](https://doc.rust-lang.org/refe
299299
> 5..=6; // std::range::legacy::RangeInclusive
300300
> ..=7; // std::range::RangeToInclusive
301301
> ```
302-
>
302+
>
303303
> The following expressions are equivalent.
304-
>
304+
>
305305
> ```rust
306306
> let x = std::range::legacy::Range {start: 0, end: 10};
307307
> let y = std::ops::Range {start: 0, end: 10};
308308
> let z = 0..10;
309-
>
309+
>
310310
> assert_eq!(x, y);
311311
> assert_eq!(x, z);
312312
> ```

0 commit comments

Comments
 (0)