Crates.io | mut_immut |
lib.rs | mut_immut |
version | 0.2.1 |
source | src |
created_at | 2022-05-30 01:01:57.28861 |
updated_at | 2022-05-30 10:06:47.759036 |
description | Change value of an immutable variable. |
homepage | |
repository | https://github.com/mrMiiao/mut_immut |
max_upload_size | |
id | 596720 |
size | 2,217 |
Change value of an immutable variable!!!
Examples:
extern crate mut_immut;
use mut_immut::change;
fn main() {
let a: u8 = 6;
change(&a, 255);
println!("{a}"); // >> 255
}
extern crate mut_immut;
use mut_immut::*;
fn main() {
let a: u8 = 15;
let mut mut_a = get_mut(&a);
*mut_a = 8;
println!("{a}"); // >> 8
}