Fun with funcs
This commit is contained in:
parent
4f55c0c186
commit
44afa4b13c
6
rustbook/functions/Cargo.toml
Normal file
6
rustbook/functions/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "functions"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Dan Buch <daniel.buch@gmail.com>"]
|
||||||
|
|
||||||
|
[dependencies]
|
10
rustbook/functions/src/main.rs
Normal file
10
rustbook/functions/src/main.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
|
||||||
|
another_function(5, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn another_function(x: i32, y: i32) {
|
||||||
|
println!("The value of x is: {}", x);
|
||||||
|
println!("The value of y is: {}", y);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user