From: Ralf Jung Date: Mon, 24 Aug 2015 08:55:59 +0000 (+0200) Subject: add links to raw source X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/832768ac8f69b436c1f90ad7a2f01af25091599a add links to raw source --- diff --git a/src/part00.rs b/src/part00.rs index 6469907..01d2046 100644 --- a/src/part00.rs +++ b/src/part00.rs @@ -111,4 +111,4 @@ pub fn main() { //@ computed that ourselves, but that's besides the point. More importantly: //@ You completed the first part of the course. -//@ [index](main.html) | previous | [next](part01.html) +//@ [index](main.html) | previous | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part00.rs) | [next](part01.html) diff --git a/src/part01.rs b/src/part01.rs index e73da23..7d29c49 100644 --- a/src/part01.rs +++ b/src/part01.rs @@ -106,4 +106,4 @@ pub fn main() { // **Exercise 01.2**: Write a function `vec_print` that takes a vector and prints all its elements. -//@ [index](main.html) | [previous](part00.html) | [next](part02.html) +//@ [index](main.html) | [previous](part00.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part01.rs) | [next](part02.html) diff --git a/src/part02.rs b/src/part02.rs index 1af74fc..3be1cdd 100644 --- a/src/part02.rs +++ b/src/part02.rs @@ -146,4 +146,4 @@ pub fn main() { // **Exercise 02.1**: Change your program such that it computes the minimum of a `Vec` (where `f32` is the type // of 32-bit floating-point numbers). You should not change `vec_min` in any way, obviously! -//@ [index](main.html) | [previous](part01.html) | [next](part03.html) +//@ [index](main.html) | [previous](part01.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part02.rs) | [next](part03.html) diff --git a/src/part03.rs b/src/part03.rs index 16527a2..548b082 100644 --- a/src/part03.rs +++ b/src/part03.rs @@ -116,4 +116,4 @@ impl SomethingOrNothing { // **Exercise 03.2**: Building on exercise 02.2, implement all the things you need on `f32` to make your // program work with floating-point numbers. -//@ [index](main.html) | [previous](part02.html) | [next](part04.html) +//@ [index](main.html) | [previous](part02.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part03.rs) | [next](part04.html) diff --git a/src/part04.rs b/src/part04.rs index 5c89466..e7cf7f2 100644 --- a/src/part04.rs +++ b/src/part04.rs @@ -143,4 +143,4 @@ fn mutable_borrow_demo() { // As it turns out, combined with the abstraction facilities of Rust, this is a very powerful mechanism // to tackle many problems beyond basic memory safety. You will see some examples for this soon. -//@ [index](main.html) | [previous](part03.html) | [next](part05.html) +//@ [index](main.html) | [previous](part03.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part04.rs) | [next](part05.html) diff --git a/src/part05.rs b/src/part05.rs index 6d2d813..6780ca3 100644 --- a/src/part05.rs +++ b/src/part05.rs @@ -147,4 +147,4 @@ fn work_on_variant(mut var: Variant, text: String) { //@ I hope this example clarifies why Rust has to rule out mutation in the presence of aliasing *in general*, //@ not just for the specific case of a buffer being reallocated, and old pointers becoming hence invalid. -//@ [index](main.html) | [previous](part04.html) | [next](part06.html) +//@ [index](main.html) | [previous](part04.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part05.rs) | [next](part06.html) diff --git a/src/part06.rs b/src/part06.rs index 4dff55c..a4ac764 100644 --- a/src/part06.rs +++ b/src/part06.rs @@ -147,4 +147,4 @@ fn rust_foo(mut v: Vec) -> i32 { //@ Most of the time, we don't have to explicitly add lifetimes to function types. This is thanks to *lifetimes elision*, //@ where Rust will automatically insert lifetimes we did not specify, following some [simple, well-documented rules](https://doc.rust-lang.org/stable/book/lifetimes.html#lifetime-elision). -//@ [index](main.html) | [previous](part05.html) | [next](part07.html) +//@ [index](main.html) | [previous](part05.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part06.rs) | [next](part07.html) diff --git a/src/part07.rs b/src/part07.rs index 49f6900..4cc58a4 100644 --- a/src/part07.rs +++ b/src/part07.rs @@ -147,4 +147,4 @@ fn test_vec_min() { // of course, need a `Display` bound on `T`.) Then you should be able to use them with `println!` just like you do // with numbers, and get rid of the inherent functions to print `SomethingOrNothing` and `SomethingOrNothing`. -//@ [index](main.html) | [previous](part06.html) | [next](part08.html) +//@ [index](main.html) | [previous](part06.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part07.rs) | [next](part08.html) diff --git a/src/part08.rs b/src/part08.rs index ad29565..2c6dfc5 100644 --- a/src/part08.rs +++ b/src/part08.rs @@ -152,4 +152,4 @@ mod tests { // **Exercise 08.6**: Write a subtraction function, and testcases for it. Decide for yourself how you want to handle negative results. // For example, you may want to return an `Option`, to panic, or to return `0`. -//@ [index](main.html) | [previous](part07.html) | [next](part09.html) +//@ [index](main.html) | [previous](part07.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part08.rs) | [next](part09.html) diff --git a/src/part09.rs b/src/part09.rs index 40e32a2..d4b3e66 100644 --- a/src/part09.rs +++ b/src/part09.rs @@ -146,4 +146,4 @@ impl<'a> IntoIterator for &'a BigInt { //@ then you will obtain ownership of the elements during the iteration - and destroy the vector in the process. We actually did that in //@ `part01::vec_min`, but we did not care. You can write `for e in &v` or `for e in v.iter()` to avoid this. -//@ [index](main.html) | [previous](part08.html) | [next](part10.html) +//@ [index](main.html) | [previous](part08.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part09.rs) | [next](part10.html) diff --git a/src/part10.rs b/src/part10.rs index 0522cb0..6969889 100644 --- a/src/part10.rs +++ b/src/part10.rs @@ -141,4 +141,4 @@ fn filter_vec_by_divisor(v: &Vec, divisor: i32) -> Vec { // product of those numbers that sit at odd positions? A function that checks whether a vector contains a certain number? Whether all numbers are // smaller than some threshold? Be creative! -//@ [index](main.html) | [previous](part09.html) | [next](part11.html) +//@ [index](main.html) | [previous](part09.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part10.rs) | [next](part11.html) diff --git a/src/part11.rs b/src/part11.rs index 211cda5..7361604 100644 --- a/src/part11.rs +++ b/src/part11.rs @@ -117,4 +117,4 @@ pub fn main() { // to work with an arbitrary type `T` that's passed to the callbacks. Since you need to call multiple callbacks with the // same `t: T`, you will either have to restrict `T` to `Copy` types, or pass a borrow. -//@ [index](main.html) | [previous](part10.html) | [next](part12.html) +//@ [index](main.html) | [previous](part10.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part11.rs) | [next](part12.html) diff --git a/src/part12.rs b/src/part12.rs index f186b2a..d88a8a6 100644 --- a/src/part12.rs +++ b/src/part12.rs @@ -161,4 +161,4 @@ fn demo_mut(c: &mut CallbacksMut) { // **Exercise 12.1**: Write some piece of code using only the available, public interface of `CallbacksMut` such that a reentrant call to a closure // is happening, and the program aborts because the `RefCell` refuses to hand out a second mutable borrow of the closure's environment. -//@ [index](main.html) | [previous](part11.html) | [next](part13.html) +//@ [index](main.html) | [previous](part11.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part12.rs) | [next](part13.html) diff --git a/src/part13.rs b/src/part13.rs index 861ec2d..7aedb71 100644 --- a/src/part13.rs +++ b/src/part13.rs @@ -189,4 +189,4 @@ pub fn main() { //@ So if the environment of your closure contains an `Rc`, it won't be `Send`, preventing it from causing trouble. If however every //@ captured variable *is* `Send`, then so is the entire environment, and you are good. -//@ [index](main.html) | [previous](part12.html) | [next](part14.html) +//@ [index](main.html) | [previous](part12.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part13.rs) | [next](part14.html) diff --git a/src/part14.rs b/src/part14.rs index 2105838..b2d32f9 100644 --- a/src/part14.rs +++ b/src/part14.rs @@ -159,4 +159,4 @@ Options: // the pattern to regular-expression mode, and change `filter_lines` to honor this option. The documentation of regex is available from its crates.io site. // (You won't be able to use the `regex!` macro if you are on the stable or beta channel of Rust. But it wouldn't help for our use-case anyway.) -//@ [index](main.html) | [previous](part13.html) | [next](part15.html) +//@ [index](main.html) | [previous](part13.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part14.rs) | [next](part15.html) diff --git a/src/part15.rs b/src/part15.rs index 19ce603..3b59825 100644 --- a/src/part15.rs +++ b/src/part15.rs @@ -144,4 +144,4 @@ pub fn main() { //@ [Rust RFC](https://github.com/rust-lang/rfcs/blob/master/text/0458-send-improvements.md), which contains a type `RcMut` that would be `Sync` and not `Send`. //@ You may also be interested in [this blog post](https://huonw.github.io/blog/2015/02/some-notes-on-send-and-sync/) on the topic. -//@ [index](main.html) | [previous](part14.html) | [next](part16.html) +//@ [index](main.html) | [previous](part14.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part15.rs) | [next](part16.html) diff --git a/src/part16.rs b/src/part16.rs index e80d80a..90b687b 100644 --- a/src/part16.rs +++ b/src/part16.rs @@ -197,4 +197,4 @@ impl Drop for LinkedList { //@ extensions here and there. The [index](main.html) contains some more links to additional resources you may find useful. //@ With that, there's only one thing left to say: Happy Rust Hacking! -//@ [index](main.html) | [previous](part15.html) | next +//@ [index](main.html) | [previous](part15.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part16.rs) | next