mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-19 17:55:37 +00:00
Simplify some encoding
This commit is contained in:
committed by
Dirkjan Ochtman
parent
1e40be2b03
commit
4b0530ba45
@@ -423,7 +423,7 @@ impl Stream {
|
||||
ty |= 0x01;
|
||||
}
|
||||
out.write_var(ty); // 1 byte
|
||||
out.write_var(self.id.0); // <=8 bytes
|
||||
out.write(self.id); // <=8 bytes
|
||||
if self.offset != 0 {
|
||||
out.write_var(self.offset); // <=8 bytes
|
||||
}
|
||||
@@ -712,7 +712,7 @@ impl FrameStruct for ResetStream {
|
||||
impl ResetStream {
|
||||
pub fn encode<W: BufMut>(&self, out: &mut W) {
|
||||
out.write(Type::RESET_STREAM); // 1 byte
|
||||
out.write_var(self.id.0); // <= 8 bytes
|
||||
out.write(self.id); // <= 8 bytes
|
||||
out.write_var(self.error_code); // <= 8 bytes
|
||||
out.write_var(self.final_offset); // <= 8 bytes
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user