Struct rect stuff

This commit is contained in:
Dan Buch 2017-12-30 22:09:26 -05:00
parent 8266d81352
commit e65f61d113
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7
2 changed files with 19 additions and 0 deletions

View File

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

View 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
}