Skip to content

Commit

Permalink
proto: move IterErr below users
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Oct 21, 2023
1 parent ce4daaf commit 55330fa
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions quinn-proto/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,29 +526,6 @@ pub(crate) struct Iter {
last_ty: Option<Type>,
}

enum IterErr {
UnexpectedEnd,
InvalidFrameId,
Malformed,
}

impl IterErr {
fn reason(&self) -> &'static str {
use self::IterErr::*;
match *self {
UnexpectedEnd => "unexpected end",
InvalidFrameId => "invalid frame ID",
Malformed => "malformed",
}
}
}

impl From<UnexpectedEnd> for IterErr {
fn from(_: UnexpectedEnd) -> Self {
Self::UnexpectedEnd
}
}

impl Iter {
pub(crate) fn new(payload: Bytes) -> Result<Self, TransportError> {
if payload.is_empty() {
Expand Down Expand Up @@ -786,6 +763,29 @@ fn scan_ack_blocks(buf: &mut io::Cursor<Bytes>, largest: u64, n: usize) -> Resul
Ok(())
}

enum IterErr {
UnexpectedEnd,
InvalidFrameId,
Malformed,
}

impl IterErr {
fn reason(&self) -> &'static str {
use self::IterErr::*;
match *self {
UnexpectedEnd => "unexpected end",
InvalidFrameId => "invalid frame ID",
Malformed => "malformed",
}
}
}

impl From<UnexpectedEnd> for IterErr {
fn from(_: UnexpectedEnd) -> Self {
Self::UnexpectedEnd
}
}

#[derive(Debug, Clone)]
pub struct AckIter<'a> {
largest: u64,
Expand Down

0 comments on commit 55330fa

Please sign in to comment.