projects
/
rust-101.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
write a lot on Copy and Clone. Now part 05 is too long...
[rust-101.git]
/
src
/
part01.rs
diff --git
a/src/part01.rs
b/src/part01.rs
index d046a1b70330f7769276a94abe9e488591a7be80..8b14050b039237af6b565adfbf70f7e2d782dbb8 100644
(file)
--- a/
src/part01.rs
+++ b/
src/part01.rs
@@
-79,7
+79,7
@@
impl NumberOrNothing {
fn read_vec() -> Vec<i32> {
vec![18,5,7,2,9,27]
}
fn read_vec() -> Vec<i32> {
vec![18,5,7,2,9,27]
}
-pub fn
part_
main() {
+pub fn main() {
let vec = read_vec();
let min = vec_min(vec);
min.print();
let vec = read_vec();
let min = vec_min(vec);
min.print();
@@
-87,7
+87,7
@@
pub fn part_main() {
// You will have to replace `part00` by `part01` in the `main` function in
// `main.rs` to run this code.
// You will have to replace `part00` by `part01` in the `main` function in
// `main.rs` to run this code.
-// **Exercise**: Write a funtion `vec_avg` that computes the average value of a `Vec<i32>`.
+// **Exercise
01.1
**: Write a funtion `vec_avg` that computes the average value of a `Vec<i32>`.
//
// *Hint*: `vec.len()` returns the length of a vector `vec`.
//
// *Hint*: `vec.len()` returns the length of a vector `vec`.