Commit ac53389
Changed files (1)
5.2
src
5.2/src/main.rs
@@ -1,3 +1,4 @@
+/*
// Regular struct
struct User {
active: bool,
@@ -38,3 +39,18 @@ fn build_user(email: String, username: String) -> User {
sign_in_count: 1,
}
}
+*/
+
+fn main() {
+ let width1 = 30;
+ let height1 = 50;
+
+ println!(
+ "The area of the rectangle is {} square pixels.",
+ area(width1, height1)
+ );
+}
+
+fn area(width: u32, height: u32) -> u32 {
+ width * height
+}