mut_base/
mut_ref.rs

1// File: ./bin-hello/examples/mut_base/mut_ref/mod.rs
2// clear && cargo run --example mut_base -- mut_ref
3
4
5//=======
6
7
8
9//=======
10#[cfg(feature = "ok")]
11pub fn adjoin() {
12    // ANCHOR: mut_ref
13    // File: ./bin-hello/examples/mut_base/mut_ref/mod.rs
14
15    let mut mut_instance = 1u8;
16    println!("1. mut_instance = {}", mut_instance);
17
18    mut_instance = 33;
19    println!("2. mut_instance = {}", mut_instance);
20
21    let ref_mut_instance = &mut mut_instance;
22    *ref_mut_instance = 42;
23    println!("3. mut_instance = {}", mut_instance);
24
25    mut_instance = 100;
26    println!("4. mut_instance = {}", mut_instance);
27
28    // ANCHOR_END: mut_ref
29}
30
31
32//=======
33#[cfg(all(
34    not(feature = "ok"),
35))]
36pub fn adjoin() {
37    use aide::*;
38    hello();
39}