Skip to content

Commit 0d38b0e

Browse files
committedNov 1, 2018
Made doc example of impl Default for … use -> Self instead of explicit self type
1 parent c613d26 commit 0d38b0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/libcore/default.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
/// }
7777
///
7878
/// impl Default for Kind {
79-
/// fn default() -> Kind { Kind::A }
79+
/// fn default() -> Self { Kind::A }
8080
/// }
8181
/// ```
8282
///
@@ -118,7 +118,7 @@ pub trait Default: Sized {
118118
/// }
119119
///
120120
/// impl Default for Kind {
121-
/// fn default() -> Kind { Kind::A }
121+
/// fn default() -> Self { Kind::A }
122122
/// }
123123
/// ```
124124
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)