Refactor Readable trait (#3309)
Currently Writable accepts trait Write as a type parameter but Readable takes Read as a trait object, which is not symmetrical and also less performant. This PR changes Readable trait and all places where it's used
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ impl SizeEntry {
|
||||
}
|
||||
|
||||
impl Readable for SizeEntry {
|
||||
fn read(reader: &mut dyn Reader) -> Result<SizeEntry, ser::Error> {
|
||||
fn read<R: Reader>(reader: &mut R) -> Result<SizeEntry, ser::Error> {
|
||||
Ok(SizeEntry {
|
||||
offset: reader.read_u64()?,
|
||||
size: reader.read_u16()?,
|
||||
|
||||
Reference in New Issue
Block a user