do it properly
This commit is contained in:
parent
bf4b8d4caa
commit
f1b3cabef9
1 changed files with 3 additions and 1 deletions
|
@ -47,7 +47,9 @@ struct SramParam {
|
||||||
|
|
||||||
impl PersistentField<'_, Vec<u8>> for SramParam {
|
impl PersistentField<'_, Vec<u8>> for SramParam {
|
||||||
fn set(&self, new_value: Vec<u8>) {
|
fn set(&self, new_value: Vec<u8>) {
|
||||||
*self.state.write().unwrap() = new_value;
|
let mut w = self.state.write().unwrap();
|
||||||
|
w.resize(new_value.len(), 0);
|
||||||
|
w.copy_from_slice(&new_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn map<F, R>(&self, f: F) -> R
|
fn map<F, R>(&self, f: F) -> R
|
||||||
|
|
Loading…
Add table
Reference in a new issue