prop ownership

This commit is contained in:
dietpi committed 2023-07-02 17:04:33 +02:00
1 parent 4507728150
commit e442e0e89f
3 files changed
+18

No files matched your search

+1
View File
@@ -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)
+8
View File
@@ -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]
+9
View File
@@ -0,0 +1,9 @@
fn vec_transfer(v: Vec<i32>) {
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]);
}