From: Ralf Jung Date: Mon, 8 Jun 2015 12:18:25 +0000 (+0200) Subject: write something on read_vec X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/2593cdbf30508a412682ed0e04e9d3a58fb69c15?hp=231a88af0700e47c79f2e900323792ec91c41530 write something on read_vec --- diff --git a/src/main.rs b/src/main.rs index 7bf7dbe..4352a50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,9 @@ // I plan to cover. They may also be helpful as an offline resource, but you're on your // own then. +// I will assume basic familiarity with programming, and hence not explain the basic +// concepts common to most languages. Instead, I will focus on what makes Rust special. + // The actual course is in the partXX.rs files. I suggest you get started with // [the first part](part00.html), or jump directly to where you left off: diff --git a/src/part00.rs b/src/part00.rs index 73fe8c1..b887eb4 100644 --- a/src/part00.rs +++ b/src/part00.rs @@ -3,6 +3,13 @@ // Rust-101, Part 00 // ================= +// As a starter, we want to write a function that computes the minimum of a list. +// First, we need to get a list. For now, let's just hard-code some sample list. +// Later, we will ask the user to input a list. +// +// Observe how in Rust, the function type comes *after* the arguments (which, in +// this case, the function does not have). `Vec` is the type of a growable list +// of (signed, 32-bit) integers. pub fn read_vec() -> Vec { vec![0,1,2,3,4]