Skip to content

Commit 60e1394

Browse files
committed
tutorial: change float to f32 since float is no longer a type.
1 parent 5681c71 commit 60e1394

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,12 +2184,12 @@ any other method, using dot notation, as in `1.print()`.
21842184
21852185
Sometimes, a method that a trait provides will have the same
21862186
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
21882188
printable, and that we wanted the implementation of `print` for those
21892189
types to be exactly as it is for `int`, above:
21902190
21912191
~~~~
2192-
impl Printable for float {
2192+
impl Printable for f32 {
21932193
fn print(&self) { println!("{:?}", *self) }
21942194
}
21952195
@@ -2220,15 +2220,15 @@ impl Printable for ~str {
22202220
22212221
impl Printable for bool {}
22222222
2223-
impl Printable for float {}
2223+
impl Printable for f32 {}
22242224
22252225
# 1.print();
22262226
# (~"foo").print();
22272227
# true.print();
22282228
# 3.14159.print();
22292229
~~~~
22302230
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
22322232
need to provide an implementation of `print`, because in the absence
22332233
of a specific implementation, Rust just uses the _default method_
22342234
provided in the trait definition. Depending on the trait, default

0 commit comments

Comments
 (0)