diff --git a/README.md b/README.md index 4a3b452..fbcd133 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,4 @@ - https://tinchicus.com/2022/07/15/rust-tuple-struct/ (nuevotipo) - https://tinchicus.com/2022/07/18/rust-enum/ (enums) - https://tinchicus.com/2022/07/19/rust-patrones-y-coincidencias/ (iflet) +- https://tinchicus.com/2022/07/20/rust-ownership/ (prop) diff --git a/prop/Cargo.toml b/prop/Cargo.toml new file mode 100644 index 0000000..9ddb275 --- /dev/null +++ b/prop/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "prop" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/prop/src/main.rs b/prop/src/main.rs new file mode 100644 index 0000000..d922089 --- /dev/null +++ b/prop/src/main.rs @@ -0,0 +1,9 @@ +fn vec_transfer(v: Vec) { + println!("v[0] en la función = {}", v[0]); +} + +fn main() { + let mivec = vec![1i32,2i32,3i32]; + vec vec_transfer(mivec); + println!("mivec[0] es = {}", mivec[0]); +}