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

library -> notebook

parent 8387288c
No related branches found
No related tags found
No related merge requests found
Pipeline #
[package]
name = "library"
name = "ownership"
version = "0.1.0"
authors = ["Orestis Malaspinas <orestis.malaspinas@hesge.ch>"]
edition = "2018"
......
......@@ -3,11 +3,11 @@ fn do_something(library: Vec<&str>) {
}
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("Rust Programming.");
library.push("Il fait beau.");
library.push("Lea oiseaux chantent.");
do_something(library);
do_something(library); // redo something
do_something(library); // ownership transféré à do_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