global static. It is immutable
This commit is contained in:
parent
1eff21e93e
commit
319948a16e
|
@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue