mirror of
https://github.com/actix/actix-web.git
synced 2024-12-23 00:26:34 +00:00
reduce branch in actix_http::h1::codec (#1854)
This commit is contained in:
parent
cbda928a33
commit
f9fcf56d5c
1 changed files with 2 additions and 2 deletions
|
@ -111,8 +111,8 @@ impl Decoder for Codec {
|
||||||
type Error = ParseError;
|
type Error = ParseError;
|
||||||
|
|
||||||
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
|
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
|
||||||
if self.payload.is_some() {
|
if let Some(ref mut payload) = self.payload {
|
||||||
Ok(match self.payload.as_mut().unwrap().decode(src)? {
|
Ok(match payload.decode(src)? {
|
||||||
Some(PayloadItem::Chunk(chunk)) => Some(Message::Chunk(Some(chunk))),
|
Some(PayloadItem::Chunk(chunk)) => Some(Message::Chunk(Some(chunk))),
|
||||||
Some(PayloadItem::Eof) => {
|
Some(PayloadItem::Eof) => {
|
||||||
self.payload.take();
|
self.payload.take();
|
||||||
|
|
Loading…
Reference in a new issue