fix some more nits
authorRalf Jung <post@ralfj.de>
Sun, 11 Feb 2018 16:50:36 +0000 (17:50 +0100)
committerRalf Jung <post@ralfj.de>
Sun, 11 Feb 2018 16:50:36 +0000 (17:50 +0100)
src/part00.rs
src/part03.rs
src/part04.rs
src/part05.rs
src/part07.rs

index eaed3d77fd7ae04c6b967362e8aae04a3441ba76..d8b4ed7bef7786efa986eff6e0afef421e7cf163 100644 (file)
@@ -5,7 +5,6 @@
 // minimum of a list.
 
 //@ ## Getting started
-
 //@ Let us start by thinking about the *type* of our function. Rust forces us to give the types of
 //@ all arguments, and the return type, before we even start writing the body. In the case of our
 //@ minimum function, we may be inclined to say that it returns a number. But then we would be in
index 2a5eb165bcacf0bedcdb6f01ad258bfd4e8f9abd..44431e6da35c2b25376b0c5f4ddac9a7e0a61089 100644 (file)
@@ -30,7 +30,7 @@ fn read_vec() -> Vec<i32> {
     //@ concurrently, that also reads from standard input? The result would be a mess. Hence
     //@ Rust requires us to `lock` standard input if we want to perform large operations on
     //@ it. (See [the documentation](https://doc.rust-lang.org/stable/std/io/struct.Stdin.html) for
-    //@ more details.) 
+    //@ more details.)
     for line in stdin.lock().lines() {
         // Rust's type for (dynamic, growable) strings is `String`. However, our variable `line`
         // here is not yet of that type: It has type `io::Result<String>`.
index faa3e311cdb4c5adafcc983dd86d43c88582de7b..21654cd3cd46b827c71993408c989bc7a8301de5 100644 (file)
@@ -101,8 +101,9 @@ fn shared_ref_demo() {
 //@ There is a second way to borrow something, a second kind of reference: The *mutable reference*.
 //@ This is a reference that comes with the promise that nobody else has *any kind of access* to
 //@ the referee - in contrast to shared references, there is no aliasing with mutable references.
-//@ It is thus always safe to perform mutation through such a reference.
-//@ Because there cannot be another reference to the same data, we could also call it a *unique* reference, but that is not their official name.
+//@ It is thus always safe to perform mutation through such a reference. Because there cannot be
+//@ another reference to the same data, we could also call it a *unique* reference, but that is not
+//@ their official name.
 
 //@ As an example, consider a function which increments every element of a vector by 1.
 //@ The type `&mut Vec<i32>` is the type of mutable references to `vec<i32>`. Because the reference
index c0a573b7750159c015f83bc7636c0d54543bca7e..7ad87545a92c80a5b21ef507b2bd26f9e40c3fab 100644 (file)
@@ -6,6 +6,7 @@
 //@ In the course of the next few parts, we are going to build a data-structure for computations
 //@ with *big* numbers. We would like to not have an upper bound to how large these numbers can
 //@ get, with the memory of the machine being the only limit.
+//@
 //@ We start by deciding how to represent such big numbers. One possibility here is to use a vector
 //@ "digits" of the number. This is like "1337" being a vector of four digits (1, 3, 3, 7), except
 //@ that we will use `u64` as type of our digits, meaning we have 2^64 individual digits. Now we
index b2ef80906006bae1dc755f4f540fbe4a5dd2efe2..b04d766b8515a6cdb1583fd38af2b120cc353e5a 100644 (file)
@@ -153,7 +153,6 @@ fn test_vec_min() {
 // **Exercise 07.1**: Add some more testcases. In particular, make sure you test the behavior of
 // `vec_min` on an empty vector. Also add tests for `BigInt::from_vec` (in particular, removing
 // trailing zeros). Finally, break one of your functions in a subtle way and watch the test fail.
-// 
 
 // **Exercise 07.2**: Go back to your good ol' `SomethingOrNothing`, and implement `Display` for it.
 // (This will, of course, need a `Display` bound on `T`.) Then you should be able to use them with