Struct rect stuff

cat-town
Dan Buch 6 years ago
parent 8266d81352
commit e65f61d113
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

@ -0,0 +1,6 @@
[package]
name = "rectangles"
version = "0.1.0"
authors = ["Dan Buch <daniel.buch@gmail.com>"]
[dependencies]

@ -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
}
Loading…
Cancel
Save