Add justification for Cow usage
This commit is contained in:
@@ -62,6 +62,9 @@ pub trait Storage {
|
|||||||
/// Reads a byte slice from the storage.
|
/// Reads a byte slice from the storage.
|
||||||
///
|
///
|
||||||
/// The `index` must designate `length` bytes in the storage.
|
/// The `index` must designate `length` bytes in the storage.
|
||||||
|
///
|
||||||
|
/// Note that we use `Cow` just because it derefs to `[u8]`. We don't really need the fact that
|
||||||
|
/// one can convert it to a `Vec`. In particular we don't do it in the store implementation.
|
||||||
fn read_slice(&self, index: StorageIndex, length: usize) -> StorageResult<Cow<[u8]>>;
|
fn read_slice(&self, index: StorageIndex, length: usize) -> StorageResult<Cow<[u8]>>;
|
||||||
|
|
||||||
/// Writes a word slice to the storage.
|
/// Writes a word slice to the storage.
|
||||||
|
|||||||
Reference in New Issue
Block a user