Skip to content

Commit 809a988

Browse files
authored
Merge pull request #2825 from DustinByfuglien/patch-1
Fix some errors in type and parameter names
2 parents a79bad2 + 36930a3 commit 809a988

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

text/1210-impl-specialization.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ operator:
4444

4545
```rust
4646
trait AddAssign<Rhs=Self> {
47-
fn add_assign(&mut self, Rhs);
47+
fn add_assign(&mut self, rhs: Rhs);
4848
}
4949
```
5050

@@ -138,7 +138,7 @@ they are always overloaded together:
138138
trait Add<Rhs=Self> {
139139
type Output;
140140
fn add(self, rhs: Rhs) -> Self::Output;
141-
fn add_assign(&mut self, Rhs);
141+
fn add_assign(&mut self, rhs: Rhs);
142142
}
143143
```
144144

@@ -153,7 +153,7 @@ full trait implementation:
153153
// the `default` qualifier here means (1) not all items are implied
154154
// and (2) those that are can be further specialized
155155
default impl<T: Clone, Rhs> Add<Rhs> for T {
156-
fn add_assign(&mut self, rhs: R) {
156+
fn add_assign(&mut self, rhs: Rhs) {
157157
let tmp = self.clone() + rhs;
158158
*self = tmp;
159159
}
@@ -1350,11 +1350,11 @@ using the `default` keyword at the `impl` level:
13501350
trait Add<Rhs=Self> {
13511351
type Output;
13521352
fn add(self, rhs: Rhs) -> Self::Output;
1353-
fn add_assign(&mut self, Rhs);
1353+
fn add_assign(&mut self, rhs: Rhs);
13541354
}
13551355

13561356
default impl<T: Clone, Rhs> Add<Rhs> for T {
1357-
fn add_assign(&mut self, rhs: R) {
1357+
fn add_assign(&mut self, rhs: Rhs) {
13581358
let tmp = self.clone() + rhs;
13591359
*self = tmp;
13601360
}

0 commit comments

Comments
 (0)