From 6eec10c83817b5f6892a534fe39725f0d60a0322 Mon Sep 17 00:00:00 2001 From: Orestis Malaspinas <orestis.malaspinas@hesge.ch> Date: Wed, 9 Jan 2019 22:51:53 +0100 Subject: [PATCH] added first code about ownership --- presentation/library/Cargo.toml | 7 +++++++ presentation/library/src/main.rs | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 presentation/library/Cargo.toml create mode 100644 presentation/library/src/main.rs diff --git a/presentation/library/Cargo.toml b/presentation/library/Cargo.toml new file mode 100644 index 0000000..fc46ddd --- /dev/null +++ b/presentation/library/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "library" +version = "0.1.0" +authors = ["Orestis Malaspinas <orestis.malaspinas@hesge.ch>"] +edition = "2018" + +[dependencies] diff --git a/presentation/library/src/main.rs b/presentation/library/src/main.rs new file mode 100644 index 0000000..4431bb1 --- /dev/null +++ b/presentation/library/src/main.rs @@ -0,0 +1,13 @@ +fn do_something(library: Vec<&str>) { + // Do something with the library +} + +fn main() { + let mut library = Vec::new(); + + library.push("Les fleurs du Mal."); + library.push("Rust Programming."); + + do_something(library); + do_something(library); // redo something +} -- GitLab