Function macro_state::proc_clear_state
source · [−]Expand description
An analogue for clear_state!
that should only be used within proc macros.
Clears the value for the specified key
, if it exists.
If an error occurs while trying to clear the state file for the specified key, the error
will be returned as the Err
variant of the std::io::Result
.
Example
use macro_state::*;
proc_write_state("my key", "test").unwrap();
assert_eq!(proc_read_state("my key").unwrap(), "test");
proc_clear_state("my key").unwrap();
assert_eq!(proc_has_state("my key"), false);