Skip to content

Commit 88a97dc

Browse files
committed
remove to_legacy
1 parent 0207008 commit 88a97dc

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

text/3550-new-range.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn takes_range(range: std::ops::Range<usize>) { ... }
129129
takes_range(0..5);
130130
// After
131131
pub fn takes_range(range: std::range::legacy::Range<usize>) { ... }
132-
takes_range((0..5).to_legacy());
132+
takes_range((0..5).into());
133133
```
134134

135135
#### Libraries
@@ -410,16 +410,6 @@ impl<Idx> Range<Idx> {
410410
}
411411
```
412412

413-
Finally, the new types should have an inherent method for converting new types to the legacy types. This can avoid the type inference issues associated with `.into()`, helping to keep auto-migrations concise.
414-
```rust
415-
impl<Idx> Range<Idx> {
416-
/// Shorthand for `legacy::Range::from(self)`
417-
pub fn to_legacy(self) -> legacy::Range<Idx> {
418-
legacy::Range::from(self)
419-
}
420-
}
421-
```
422-
423413
# Drawbacks
424414
[drawbacks]: #drawbacks
425415

0 commit comments

Comments
 (0)