@@ -2184,12 +2184,12 @@ any other method, using dot notation, as in `1.print()`.
2184
2184
2185
2185
Sometimes, a method that a trait provides will have the same
2186
2186
implementation for most or all of the types that implement that trait.
2187
- For instance, suppose that we wanted `bool`s and `float `s to be
2187
+ For instance, suppose that we wanted `bool`s and `f32 `s to be
2188
2188
printable, and that we wanted the implementation of `print` for those
2189
2189
types to be exactly as it is for `int`, above:
2190
2190
2191
2191
~~~~
2192
- impl Printable for float {
2192
+ impl Printable for f32 {
2193
2193
fn print(&self) { println!("{:?}", *self) }
2194
2194
}
2195
2195
@@ -2220,15 +2220,15 @@ impl Printable for ~str {
2220
2220
2221
2221
impl Printable for bool {}
2222
2222
2223
- impl Printable for float {}
2223
+ impl Printable for f32 {}
2224
2224
2225
2225
# 1.print();
2226
2226
# (~"foo").print();
2227
2227
# true.print();
2228
2228
# 3.14159.print();
2229
2229
~~~~
2230
2230
2231
- Here, the impls of `Printable` for `int`, `bool`, and `float ` don't
2231
+ Here, the impls of `Printable` for `int`, `bool`, and `f32 ` don't
2232
2232
need to provide an implementation of `print`, because in the absence
2233
2233
of a specific implementation, Rust just uses the _default method_
2234
2234
provided in the trait definition. Depending on the trait, default
0 commit comments