Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
18 additions
and
0 deletions.
-
+18
−0
src/main.rs
|
@@ -45,6 +45,13 @@ fn s_truct() { |
|
|
//let _o = Mary(1, 1); // oddly does not work |
|
|
} |
|
|
|
|
|
fn e_num() { |
|
|
enum CumPass { |
|
|
North, East, West, South, |
|
|
} |
|
|
let _enum = CumPass::West; |
|
|
} |
|
|
|
|
|
use std::collections::HashMap; |
|
|
fn hmap() { |
|
|
let mut book_reviews = HashMap::new(); |
|
@@ -57,10 +64,21 @@ fn hmap() { |
|
|
assert_eq!(x, "foo"); |
|
|
} |
|
|
|
|
|
fn wat() { |
|
|
type _Dingus = &'static str; |
|
|
// what the heck is going on here? I the book says |
|
|
struct Zoo { |
|
|
n: _Dingus, |
|
|
} |
|
|
let _z = Zoo { n: "foo" }; |
|
|
// In what other context can I use _dingus? |
|
|
} |
|
|
|
|
|
fn main() { |
|
|
get_element_n_of_string(); |
|
|
misreuse_of_closure(); |
|
|
bytes_to_utf8(); |
|
|
hmap(); |
|
|
s_truct(); |
|
|
e_num(); |
|
|
} |
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.