From 2593cdbf30508a412682ed0e04e9d3a58fb69c15 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 8 Jun 2015 14:18:25 +0200 Subject: [PATCH] write something on read_vec --- src/main.rs | 3 +++ src/part00.rs | 7 +++++++ 2 files changed, 10 insertions(+) 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] -- 2.30.2