Ownership scope fun
This commit is contained in:
parent
c49281b26d
commit
eace2dafe4
6
rustbook/ownership/Cargo.toml
Normal file
6
rustbook/ownership/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "ownership"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Dan Buch <daniel.buch@gmail.com>"]
|
||||||
|
|
||||||
|
[dependencies]
|
9
rustbook/ownership/src/main.rs
Normal file
9
rustbook/ownership/src/main.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fn main() {
|
||||||
|
{
|
||||||
|
let mut s = String::from("hello");
|
||||||
|
|
||||||
|
s.push_str(", world!");
|
||||||
|
|
||||||
|
println!("{}", s);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user