add a README explaining the purpose of the workspace/ folder
[rust-101.git] / src / part07.rs
index eb1e0dc8e37ace30ba1693dfaf2ec3665e1a7f41..2d88390c82f88956c91d2e3c3149288374bf7b29 100644 (file)
@@ -4,8 +4,8 @@
 pub use part05::BigInt;
 
 // With our new knowledge of lifetimes, we are now able to write down the desired type of `min`:
-//@ We want the function to take two borrows *of the same lifetime*, and then
-//@ return a borrow of that lifetime. If the two input lifetimes would be different, we
+//@ We want the function to take two references *with the same lifetime*, and then
+//@ return a reference with that lifetime. If the two input lifetimes would be different, we
 //@ would not know which lifetime to use for the result.
 pub trait Minimum {
     fn min<'a>(&'a self, other: &'a Self) -> &'a Self;
@@ -66,7 +66,7 @@ impl PartialEq for BigInt {
 //@ and [`Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html). `Eq` can be automatically derived as well.
 
 // Now we can compare `BigInt`s. Rust treats `PartialEq` special in that it is wired to the operator `==`:
-//@ That operator can not be used on our numbers! Speaking in C++ terms, we just overloaded the `==` operator
+//@ That operator can now be used on our numbers! Speaking in C++ terms, we just overloaded the `==` operator
 //@ for `BigInt`. Rust does not have function overloading (i.e., it will not dispatch to different
 //@ functions depending on the type of the argument). Instead, one typically finds (or defines) a
 //@ trait that catches the core characteristic common to all the overloads, and writes a single