global static. It is immutable
This commit is contained in:
parent
1eff21e93e
commit
319948a16e
26 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue