From e8cb1a8966a7662eeb9fc19173a5498f7cd815b6 Mon Sep 17 00:00:00 2001 From: Nicola 'tekNico' Larosa Date: Sun, 21 Jan 2018 19:22:12 +0100 Subject: [PATCH] part01.rs lines shortened --- src/part01.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/part01.rs b/src/part01.rs index 95e4593..a4537ac 100644 --- a/src/part01.rs +++ b/src/part01.rs @@ -43,9 +43,10 @@ fn compute_stuff(x: i32) -> i32 { // Let us now refactor `vec_min`. fn vec_min(v: Vec) -> NumberOrNothing { - //@ Remember that helper function `min_i32`? Rust allows us to define such helper functions *inside* other - //@ functions. This is just a matter of namespacing, the inner function has no access to the data of the outer - //@ one. Still, being able to nicely group functions can significantly increase readability. + //@ Remember that helper function `min_i32`? Rust allows us to define such helper functions + //@ *inside* other functions. This is just a matter of namespacing, the inner function has no + //@ access to the data of the outer one. Still, being able to nicely group functions can + //@ significantly increase readability. fn min_i32(a: i32, b: i32) -> i32 { if a < b { a } else { b } /*@*/ } @@ -106,4 +107,5 @@ 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) | [raw source](workspace/src/part01.rs) | [next](part02.html) +//@ [index](main.html) | [previous](part00.html) | [raw source](workspace/src/part01.rs) | +//@ [next](part02.html) -- 2.30.2