Add new projects
This commit is contained in:
parent
e6bc4ef483
commit
f28d70b9b8
7
functions/Cargo.lock
generated
Normal file
7
functions/Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "functions"
|
||||||
|
version = "0.1.0"
|
8
functions/Cargo.toml
Normal file
8
functions/Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "functions"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
11
functions/src/main.rs
Normal file
11
functions/src/main.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fn main() {
|
||||||
|
print_labeled_measurement(37, 'h');
|
||||||
|
}
|
||||||
|
|
||||||
|
fn another_function(x: i32) {
|
||||||
|
println!("The value of x is: {x}");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn print_labeled_measurement(value: i32, unit_label: char) {
|
||||||
|
println!("The measurement is: {value}{unit_label}");
|
||||||
|
}
|
7
variables/Cargo.lock
generated
Normal file
7
variables/Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "variables"
|
||||||
|
version = "0.1.0"
|
8
variables/Cargo.toml
Normal file
8
variables/Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "variables"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
11
variables/src/main.rs
Normal file
11
variables/src/main.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fn main() {
|
||||||
|
let x = 5;
|
||||||
|
let x = x + 1;
|
||||||
|
|
||||||
|
{
|
||||||
|
let x=x*2;
|
||||||
|
println!("The value of x in the inner scope is: {x}");
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("The value of x is: {x}");
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user