Structs but not structs
This commit is contained in:
13
structs/src/main.rs
Normal file
13
structs/src/main.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user