summaryrefslogtreecommitdiff
path: root/exercises/17_tests/tests4.rs
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/17_tests/tests4.rs')
-rw-r--r--exercises/17_tests/tests4.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/exercises/17_tests/tests4.rs b/exercises/17_tests/tests4.rs
index 0972a5b..35a9a3b 100644
--- a/exercises/17_tests/tests4.rs
+++ b/exercises/17_tests/tests4.rs
@@ -1,13 +1,8 @@
-// tests4.rs
-//
// Make sure that we're testing for the correct conditions!
-//
-// Execute `rustlings hint tests4` or use the `hint` watch subcommand for a
-// hint.
struct Rectangle {
width: i32,
- height: i32
+ height: i32,
}
impl Rectangle {
@@ -16,10 +11,14 @@ impl Rectangle {
if width <= 0 || height <= 0 {
panic!("Rectangle width and height cannot be negative!")
}
- Rectangle {width, height}
+ Rectangle { width, height }
}
}
+fn main() {
+ // You can optionally experiment here.
+}
+
#[cfg(test)]
mod tests {
use super::*;