Skip to content

Commit 5e5be5a

Browse files
authored
Merge pull request #420 from mark-i-m/anon_params
No more anonymous trait fn parameters
2 parents d0434b2 + 3fe8575 commit 5e5be5a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: src/items/associated-items.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Consider the following trait:
9999
# type Surface = i32;
100100
# type BoundingBox = i32;
101101
trait Shape {
102-
fn draw(&self, Surface);
102+
fn draw(&self, surface: Surface);
103103
fn bounding_box(&self) -> BoundingBox;
104104
}
105105
```
@@ -112,7 +112,7 @@ of this trait while the trait is in scope can have their `draw` and
112112
# type Surface = i32;
113113
# type BoundingBox = i32;
114114
# trait Shape {
115-
# fn draw(&self, Surface);
115+
# fn draw(&self, surface: Surface);
116116
# fn bounding_box(&self) -> BoundingBox;
117117
# }
118118
#
@@ -191,7 +191,7 @@ available for use in the method signatures:
191191
trait Container {
192192
type E;
193193
fn empty() -> Self;
194-
fn insert(&mut self, Self::E);
194+
fn insert(&mut self, elem: Self::E);
195195
}
196196
```
197197

@@ -203,7 +203,7 @@ implementation of `Container` for the standard library type `Vec`:
203203
# trait Container {
204204
# type E;
205205
# fn empty() -> Self;
206-
# fn insert(&mut self, Self::E);
206+
# fn insert(&mut self, elem: Self::E);
207207
# }
208208
impl<T> Container for Vec<T> {
209209
type E = T;

Diff for: src/items/traits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ after the trait name, using the same syntax used in [generic functions].
3232
trait Seq<T> {
3333
fn len(&self) -> u32;
3434
fn elt_at(&self, n: u32) -> T;
35-
fn iter<F>(&self, F) where F: Fn(T);
35+
fn iter<F>(&self, f: F) where F: Fn(T);
3636
}
3737
```
3838

0 commit comments

Comments
 (0)