]> git.lizzy.rs Git - rust.git/commitdiff
tutorial: change `float` to `f32` since float is no longer a type.
authorLindsey Kuper <lindsey@composition.al>
Sun, 5 Jan 2014 03:10:33 +0000 (22:10 -0500)
committerLindsey Kuper <lindsey@composition.al>
Mon, 6 Jan 2014 03:03:13 +0000 (22:03 -0500)
doc/tutorial.md

index 928815b8298afac29c1708c84ea599547c7d1d66..80f8c3a53eb5febe5a6ac8ba2127f1c60809930d 100644 (file)
@@ -2184,12 +2184,12 @@ any other method, using dot notation, as in `1.print()`.
 
 Sometimes, a method that a trait provides will have the same
 implementation for most or all of the types that implement that trait.
-For instance, suppose that we wanted `bool`s and `float`s to be
+For instance, suppose that we wanted `bool`s and `f32`s to be
 printable, and that we wanted the implementation of `print` for those
 types to be exactly as it is for `int`, above:
 
 ~~~~
-impl Printable for float {
+impl Printable for f32 {
     fn print(&self) { println!("{:?}", *self) }
 }
 
@@ -2220,7 +2220,7 @@ impl Printable for ~str {
 
 impl Printable for bool {}
 
-impl Printable for float {}
+impl Printable for f32 {}
 
 # 1.print();
 # (~"foo").print();
@@ -2228,7 +2228,7 @@ impl Printable for float {}
 # 3.14159.print();
 ~~~~
 
-Here, the impls of `Printable` for `int`, `bool`, and `float` don't
+Here, the impls of `Printable` for `int`, `bool`, and `f32` don't
 need to provide an implementation of `print`, because in the absence
 of a specific implementation, Rust just uses the _default method_
 provided in the trait definition.  Depending on the trait, default