Skip to content

Commit

Permalink
Fix some errors in type and parameter names
Browse files Browse the repository at this point in the history
Suggest to fix a few errors/typos:
1. Erronously named type ```R``` renamed to ```Rhs```
2. Name some anonymous parameters (as later they are deprecated by RFC#1685)
  • Loading branch information
DustinByfuglien authored Nov 28, 2019
1 parent a79bad2 commit 36930a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions text/1210-impl-specialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ operator:

```rust
trait AddAssign<Rhs=Self> {
fn add_assign(&mut self, Rhs);
fn add_assign(&mut self, rhs: Rhs);
}
```

Expand Down Expand Up @@ -138,7 +138,7 @@ they are always overloaded together:
trait Add<Rhs=Self> {
type Output;
fn add(self, rhs: Rhs) -> Self::Output;
fn add_assign(&mut self, Rhs);
fn add_assign(&mut self, rhs: Rhs);
}
```

Expand All @@ -153,7 +153,7 @@ full trait implementation:
// the `default` qualifier here means (1) not all items are implied
// and (2) those that are can be further specialized
default impl<T: Clone, Rhs> Add<Rhs> for T {
fn add_assign(&mut self, rhs: R) {
fn add_assign(&mut self, rhs: Rhs) {
let tmp = self.clone() + rhs;
*self = tmp;
}
Expand Down Expand Up @@ -1350,11 +1350,11 @@ using the `default` keyword at the `impl` level:
trait Add<Rhs=Self> {
type Output;
fn add(self, rhs: Rhs) -> Self::Output;
fn add_assign(&mut self, Rhs);
fn add_assign(&mut self, rhs: Rhs);
}

default impl<T: Clone, Rhs> Add<Rhs> for T {
fn add_assign(&mut self, rhs: R) {
fn add_assign(&mut self, rhs: Rhs) {
let tmp = self.clone() + rhs;
*self = tmp;
}
Expand Down

0 comments on commit 36930a3

Please sign in to comment.