#immutability #mutation #freeze #disable #contained

freezie

freezie is a small library that disables mutation for the contained type

1 stable release

1.0.0 Feb 24, 2023

#503 in Memory management

Download history 63/week @ 2024-07-27 17/week @ 2024-08-03 89/week @ 2024-08-10 16/week @ 2024-08-17 74/week @ 2024-08-24 26/week @ 2024-08-31 9/week @ 2024-09-07 57/week @ 2024-09-14 60/week @ 2024-09-21 29/week @ 2024-09-28 57/week @ 2024-10-05 39/week @ 2024-10-12 6/week @ 2024-10-19 2/week @ 2024-10-26 48/week @ 2024-11-02 13/week @ 2024-11-09

69 downloads per month

MIT license

5KB
51 lines

Freezie

A wrapper type with no DerefMut impl, disallowing mutation

use freezie::Freeze;
let mut v = Freeze::new(vec![1, 2, 3]);
v.push(1); // ERROR - cannot borrow data in dereference of ...

lib.rs:

freezie

A wrapper type with no DerefMut impl, disallowing mutation

use domain_list::freeze::Freeze;
let mut v = Freeze::new(vec![1, 2, 3]);
v.push(1); // ERROR - cannot borrow data in dereference of ...

No runtime deps