summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolivia <olivia@fastmail.com>2018-11-26 11:46:26 +0100
committerolivia <olivia@fastmail.com>2018-11-26 11:46:26 +0100
commit586285cd0b9b309e6823885a31871adf8f933294 (patch)
treecd8f883f71e01455cceee24c82151187ab0d1e53
parenta4b4350b70a4af46abf9d3d27bef1459a9b58521 (diff)
parent5a671079d6c4528fdab30937912099d45c029b49 (diff)
Merge branch 'master' into new
-rw-r--r--ex6.rs47
1 files changed, 47 insertions, 0 deletions
diff --git a/ex6.rs b/ex6.rs
new file mode 100644
index 0000000..33e589d
--- /dev/null
+++ b/ex6.rs
@@ -0,0 +1,47 @@
+// ex6.rs
+// Make me compile! Scroll down for hints :)
+
+fn main() {
+ let robot_name = Some(String::from("Bors"));
+
+ match robot_name {
+ Some(name) => println!("Found a name: {}", name),
+ None => (),
+ }
+
+ println!("robot_name is: {:?}", robot_name);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// Hint: The following two statements are equivalent:
+// let x = &y;
+// let ref x = y;