diff options
| author | mo8it <mo8it@proton.me> | 2024-04-17 22:46:21 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-17 22:46:21 +0200 |
| commit | cb9f1ac9ce3c834b0cca964b6809b74508f80b54 (patch) | |
| tree | f168d86b6035d7d9e357ac53cd36c2b8928f399b /exercises/13_error_handling | |
| parent | d83cc69afecf59fba184755591d73c7208988574 (diff) | |
Require a main function in all exercises
Diffstat (limited to 'exercises/13_error_handling')
| -rw-r--r-- | exercises/13_error_handling/errors1.rs | 4 | ||||
| -rw-r--r-- | exercises/13_error_handling/errors2.rs | 4 | ||||
| -rw-r--r-- | exercises/13_error_handling/errors4.rs | 4 | ||||
| -rw-r--r-- | exercises/13_error_handling/errors6.rs | 4 |
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::*; |
