X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/02337846140cac7ff30e3cc64fd3c9a024bee17c..375923e203d323dadc639434ebc1f29530f4ac2a:/src/part02.rs diff --git a/src/part02.rs b/src/part02.rs index 235e22d..a97c367 100644 --- a/src/part02.rs +++ b/src/part02.rs @@ -21,7 +21,6 @@ pub use self::SomethingOrNothing::*; //@ What this does is define an entire family of types: We can now write //@ `SomethingOrNothing` to get back our `NumberOrNothing`. type NumberOrNothing = SomethingOrNothing; - //@ However, we can also write `SomethingOrNothing` or even //@ `SomethingOrNothing>`. In fact, a type like `SomethingOrNothing` is so //@ useful that it is already present in the standard library: It's called an *option type*, @@ -122,8 +121,6 @@ impl Minimum for i32 { } // We again provide a `print` function. - - //@ This also shows that we can have multiple `impl` blocks for the same type (remember that //@ `NumberOrNothing` is just a type alias for `SomethingOrNothing`), and we can provide some //@ methods only for certain instances of a generic type.