Crate dirty_static

Crate dirty_static 

Source
Expand description

This crate provides a container for a value, DirtyStatic, which allows mutation in debug mode (via UnsafeCell), but not in release mode.

This allows you to tweak data while testing an application, without having that data be mutable when the application is released.

There are also two features available:

  1. force-dynamic which allows replacing the value of a DirtyStatic even in release mode.
  2. force-static which disallows replacing the value of a DirtyStatic even in debug mode.

Structsยง

DirtyStatic
A container for a value which allows interior mutation only in debug mode. (Or when enabled via force-dynamic feature.)