Skip to content
Snippets Groups Projects
Commit feb6ddfb authored by orestis.malaspin's avatar orestis.malaspin
Browse files

library -> notebook

parent 8387288c
Branches
No related tags found
No related merge requests found
Pipeline #
[package] [package]
name = "library" name = "ownership"
version = "0.1.0" version = "0.1.0"
authors = ["Orestis Malaspinas <orestis.malaspinas@hesge.ch>"] authors = ["Orestis Malaspinas <orestis.malaspinas@hesge.ch>"]
edition = "2018" edition = "2018"
......
...@@ -3,11 +3,11 @@ fn do_something(library: Vec<&str>) { ...@@ -3,11 +3,11 @@ fn do_something(library: Vec<&str>) {
} }
fn main() { fn main() {
let mut library = Vec::new(); let mut notebook = Vec::new(); // par défaut notebook est immutable
library.push("Les fleurs du Mal."); library.push("Il fait beau.");
library.push("Rust Programming."); library.push("Lea oiseaux chantent.");
do_something(library); do_something(library); // ownership transféré à do_something
do_something(library); // redo something // do_something(library); // redo something
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment