I was trying to use StorageString to save string values according to this file.
But when I run it in the playground, it gives me the below error.
No method named "write_slice" found for type "StorageKey<StorageString>".
Here is the code I ran,
contract;
use std::{storage::storage_string::StorageString, bytes::Bytes, string::String};
storage {
stored_string: StorageString = StorageString {}
}
fn foo() {
let mut bytes = Bytes::new();
bytes.push(5_u8);
bytes.push(7_u8);
bytes.push(9_u8);
let string = String::from(bytes);
storage.stored_string.write_slice(string);
}