mirror of
https://github.com/ahgamut/rust-ape-example.git
synced 2024-05-15 10:02:42 +00:00
d976dc883b
via panflute and https://github.com/rust-lang/rust-by-example
29 lines
727 B
Rust
29 lines
727 B
Rust
// ./src/variable_bindings.md
|
|
|
|
|
|
fn part0() {
|
|
let an_integer = 1u32;
|
|
let a_boolean = true;
|
|
let unit = ();
|
|
|
|
// copy `an_integer` into `copied_integer`
|
|
let copied_integer = an_integer;
|
|
|
|
println!("An integer: {:?}", copied_integer);
|
|
println!("A boolean: {:?}", a_boolean);
|
|
println!("Meet the unit value: {:?}", unit);
|
|
|
|
// The compiler warns about unused variable bindings; these warnings can
|
|
// be silenced by prefixing the variable name with an underscore
|
|
let _unused_variable = 3u32;
|
|
|
|
// let noisy_unused_variable = 2u32;
|
|
// FIXME ^ Prefix with an underscore to suppress the warning
|
|
// Please note that warnings may not be shown in a browser
|
|
}
|
|
|
|
pub fn main() {
|
|
part0();
|
|
}
|
|
|