From: Ralf Jung Date: Tue, 7 Jul 2015 11:22:38 +0000 (+0200) Subject: part 05: clarify exercise X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/ff4d137ae8e7a6f126d845084009ebdfc990aa47?hp=-c part 05: clarify exercise --- ff4d137ae8e7a6f126d845084009ebdfc990aa47 diff --git a/src/part05.rs b/src/part05.rs index 7324d13..b3b428e 100644 --- a/src/part05.rs +++ b/src/part05.rs @@ -111,7 +111,7 @@ impl Clone for SomethingOrNothing { //@ `#[derive(Clone)]` right before the definition of `SomethingOrNothing`. // **Exercise 05.2**: Write some more functions on `BigInt`. What about a function that returns the number of -// digits? The number of non-zero digits? The smallest/largest digit? +// digits? The number of non-zero digits? The smallest/largest digit? Of course, these should all just borrow `self`. // ## Mutation + aliasing considered harmful (part 2) //@ Now that we know how to borrow a part of an `enum` (like `v` above), there's another example for why we diff --git a/workspace/src/part05.rs b/workspace/src/part05.rs index d3c9544..f1c5587 100644 --- a/workspace/src/part05.rs +++ b/workspace/src/part05.rs @@ -59,7 +59,7 @@ impl Clone for SomethingOrNothing { } // **Exercise 05.2**: Write some more functions on `BigInt`. What about a function that returns the number of -// digits? The number of non-zero digits? The smallest/largest digit? +// digits? The number of non-zero digits? The smallest/largest digit? Of course, these should all just borrow `self`. // ## Mutation + aliasing considered harmful (part 2) enum Variant {