File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,12 @@ pub struct PathId(pub(crate) u32);
20
20
impl coding:: Codec for PathId {
21
21
fn decode < B : bytes:: Buf > ( r : & mut B ) -> coding:: Result < Self > {
22
22
let v = VarInt :: decode ( r) ?;
23
- // TODO(@flub): Mapping this error is not nice, maybe the error type should have 2
24
- // variants.
25
23
let v = u32:: try_from ( v. 0 ) . map_err ( |_| coding:: UnexpectedEnd ) ?;
26
- Ok ( Self ( v as u32 ) )
24
+ Ok ( Self ( v) )
27
25
}
28
26
29
27
fn encode < B : bytes:: BufMut > ( & self , w : & mut B ) {
30
- VarInt ( self . 0 as u64 ) . encode ( w)
28
+ VarInt ( self . 0 . into ( ) ) . encode ( w)
31
29
}
32
30
}
33
31
Original file line number Diff line number Diff line change @@ -773,6 +773,7 @@ impl TryFrom<u64> for TransportParameterId {
773
773
id if Self :: GreaseQuicBit == id => Self :: GreaseQuicBit ,
774
774
id if Self :: MinAckDelayDraft07 == id => Self :: MinAckDelayDraft07 ,
775
775
id if Self :: ObservedAddr == id => Self :: ObservedAddr ,
776
+ id if Self :: InitialMaxPathId == id => Self :: InitialMaxPathId ,
776
777
_ => return Err ( ( ) ) ,
777
778
} ;
778
779
Ok ( param)
You can’t perform that action at this time.
0 commit comments