chiark
/
gitweb
/
~ijackson
/
talk-2019-ghm-rust.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
better conclusion
[talk-2019-ghm-rust.git]
/
borrow-mut-example.txt
1
fn main() {
2
let mut s = String::from("hello");
3
change(&mut s);
4
println!("{}", s);
5
}
6
7
fn change(some_string: &mut String) {
8
some_string.push_str(", world");
9
}