You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
impl<'a> Input for ByteSliceInput<'a> {
fn remaining_len(&mut self) -> Result<usize, CodecError> {
let remaining = if self.offset <= self.data.len() {
Some(self.data.len() - self.offset)
} else {
None
};
Ok(remaining.unwrap())
}
fn read(&mut self, into: &mut [u8]) -> Result<(), CodecError> {
let range = self.take(into.len())?;
into.copy_from_slice(&self.data[range]);
Ok(())
}
fn read_byte(&mut self) -> Result<u8, CodecError> {
if self.offset + 1 > self.data.len() {
return Err("out of data".into());
}
let byte = self.data[self.offset];
self.offset += 1;
Ok(byte)
}
}
Original:
impl<'a> Input for ByteSliceInput<'a> {
fn remaining_len(&mut self) -> Result<Option<usize>, CodecError> {
let remaining = if self.offset <= self.data.len() {
Some(self.data.len() - self.offset)
} else {
None
};
Ok(remaining)
}
fn read(&mut self, into: &mut [u8]) -> Result<(), CodecError> {
let range = self.take(into.len())?;
into.copy_from_slice(&self.data[range]);
Ok(())
}
fn read_byte(&mut self) -> Result<u8, CodecError> {
if self.offset + 1 > self.data.len() {
return Err("out of data".into());
}
let byte = self.data[self.offset];
self.offset += 1;
Ok(byte)
}
}
The text was updated successfully, but these errors were encountered:
marlonhanks
changed the title
possible breaking change in test-support/tetsy-reference-trie/lib.rs
possible breaking change in test-support/tetsy-reference-trie/lib.rs @tetsy-memory-db-v0.19
Feb 25, 2021
line 587 modification:
Original:
The text was updated successfully, but these errors were encountered: