Structs but not structs
This commit is contained in:
parent
8fb44f13ef
commit
af84bc41e7
5
structs/Cargo.lock
generated
Normal file
5
structs/Cargo.lock
generated
Normal file
@ -0,0 +1,5 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "structs"
|
||||
version = "0.1.0"
|
9
structs/Cargo.toml
Normal file
9
structs/Cargo.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "structs"
|
||||
version = "0.1.0"
|
||||
authors = ["Dan Buch <dan@meatballhat.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
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
|
||||
}
|
Loading…
Reference in New Issue
Block a user