Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
16 additions
and
1 deletion.
-
+2
−0
.gitignore
-
+4
−0
Cargo.toml
-
+3
−1
README.md
-
+7
−0
src/main.rs
|
|
@@ -0,0 +1,2 @@ |
|
|
target/ |
|
|
Cargo.lock |
|
|
@@ -0,0 +1,4 @@ |
|
|
[package] |
|
|
version = "0.0.1" |
|
|
name = "foo" |
|
|
authors = ["m@b.com"]
|
|
|
@@ -1,4 +1,6 @@ |
|
|
#Rustafari |
|
|
# Rustafari |
|
|
|
|
|
Here I and I I-rate da Rust example. |
|
|
|
|
|
I am learning Rust. This is a big mish mash of experimentation and compilable nonsense. |
|
|
|
|
|
|
@@ -6,6 +6,13 @@ fn get_element_n_of_string() { |
|
|
println!("{}", chars[0]); |
|
|
} |
|
|
|
|
|
fn misreuse_of_closure() { |
|
|
let example_closure = |x| x; |
|
|
let _s = example_closure(String::from("hello")); |
|
|
//let n = example_closure(5); // cannot do this! |
|
|
} |
|
|
|
|
|
fn main() { |
|
|
get_element_n_of_string(); |
|
|
misreuse_of_closure(); |
|
|
} |
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.