Skip to content

Commit

Permalink
Revise read control flow for clarity.
Browse files Browse the repository at this point in the history
While seemingly duplicating some control flow between
`poll_next_strean` and `poll_read_stream`, the individual
control flow of each read operation is easier to follow.
  • Loading branch information
Roman S. Borschel committed Sep 25, 2020
1 parent 7ed7e01 commit 7bd1498
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 201 deletions.
17 changes: 0 additions & 17 deletions muxers/mplex/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,6 @@ impl Frame<RemoteStreamId> {
pub fn local_id(&self) -> LocalStreamId {
self.remote_id().into_local()
}

/// Returns true if this is a `Data` frame.
pub fn is_data(&self) -> bool {
match self {
Frame::Data { .. } => true,
_ => false,
}
}

/// Returns true if this is an `Open` frame.
pub fn is_open(&self) -> bool {
if let Frame::Open { .. } = self {
true
} else {
false
}
}
}

pub struct Codec {
Expand Down
Loading

0 comments on commit 7bd1498

Please sign in to comment.