summaryrefslogtreecommitdiff
path: root/exercises/13_error_handling
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/13_error_handling')
-rw-r--r--exercises/13_error_handling/errors1.rs4
-rw-r--r--exercises/13_error_handling/errors2.rs4
-rw-r--r--exercises/13_error_handling/errors4.rs4
-rw-r--r--exercises/13_error_handling/errors6.rs4
4 files changed, 16 insertions, 0 deletions
diff --git a/exercises/13_error_handling/errors1.rs b/exercises/13_error_handling/errors1.rs
index 9767f2c..7991c42 100644
--- a/exercises/13_error_handling/errors1.rs
+++ b/exercises/13_error_handling/errors1.rs
@@ -9,6 +9,10 @@
// Execute `rustlings hint errors1` or use the `hint` watch subcommand for a
// hint.
+fn main() {
+ // You can optionally experiment here.
+}
+
pub fn generate_nametag_text(name: String) -> Option<String> {
if name.is_empty() {
// Empty names aren't allowed.
diff --git a/exercises/13_error_handling/errors2.rs b/exercises/13_error_handling/errors2.rs
index 88d1bf4..051516b 100644
--- a/exercises/13_error_handling/errors2.rs
+++ b/exercises/13_error_handling/errors2.rs
@@ -29,6 +29,10 @@ pub fn total_cost(item_quantity: &str) -> Result<i32, ParseIntError> {
Ok(qty * cost_per_item + processing_fee)
}
+fn main() {
+ // You can optionally experiment here.
+}
+
#[cfg(test)]
mod tests {
use super::*;
diff --git a/exercises/13_error_handling/errors4.rs b/exercises/13_error_handling/errors4.rs
index 0e5c08b..9449417 100644
--- a/exercises/13_error_handling/errors4.rs
+++ b/exercises/13_error_handling/errors4.rs
@@ -19,6 +19,10 @@ impl PositiveNonzeroInteger {
}
}
+fn main() {
+ // You can optionally experiment here.
+}
+
#[test]
fn test_creation() {
assert!(PositiveNonzeroInteger::new(10).is_ok());
diff --git a/exercises/13_error_handling/errors6.rs b/exercises/13_error_handling/errors6.rs
index de73a9a..363a3b9 100644
--- a/exercises/13_error_handling/errors6.rs
+++ b/exercises/13_error_handling/errors6.rs
@@ -54,6 +54,10 @@ impl PositiveNonzeroInteger {
}
}
+fn main() {
+ // You can optionally experiment here.
+}
+
#[cfg(test)]
mod test {
use super::*;