global static. It is immutable

This commit is contained in:
Vincent Batts 2023-01-16 11:49:43 -05:00
parent 1eff21e93e
commit 319948a16e
26 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,6 @@
static BANNER: &str = "Welcome to Rust";
const DIGEST_SIZE: usize = 3;
const ZERO: Option<u8> = Some(42);
@ -10,6 +13,8 @@ fn compute_digest(text: &str) -> [u8; DIGEST_SIZE] {
}
fn main() {
println!("{BANNER}");
let digest = compute_digest("Hello");
println!("digest: {digest:?}");
}

Binary file not shown.