Commit 82f0f714 authored by Hero Bird's avatar Hero Bird
Browse files

[pdsl_core] Remove TypedChunkCell::load (unused for now)

parent be555eb9
......@@ -72,30 +72,6 @@ impl<'a, T> TypedChunkCell<'a, T> {
}
}
impl<'a, T> TypedChunkCell<'a, T>
where
T: parity_codec::Decode
{
/// Loads the value stored in the cell if any.
///
/// # Panics
///
/// If decoding of the loaded bytes fails.
pub fn load(&self) -> Option<T> {
self
.cell
.load()
.map(|loaded| {
T::decode(&mut &loaded[..])
// Maybe we should return an error instead of panicking.
.expect(
"[pdsl_core::TypedChunkCell::load] Error: \
failed upon decoding"
)
})
}
}
impl<'a, T> TypedChunkCell<'a, T>
where
T: parity_codec::Encode
......@@ -158,7 +134,7 @@ impl<T> TypedChunk<T> {
/// Removes the value stored in the `n`-th cell.
pub fn clear(&mut self, n: u32) {
self.chunk.clear(n)
self.cell_at(n).clear()
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment