mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-23 22:51:07 +01:00
Simplify bcodec decode (#162)
This commit is contained in:
parent
8d0bd7ce1c
commit
5d6d309e66
@ -4,6 +4,7 @@
|
||||
* Use `.advance()` instead of `.split_to()`.
|
||||
* Upgrade `tokio-util` to `0.3`.
|
||||
* Improve `BytesCodec` `.encode()` performance
|
||||
* Simplify `BytesCodec` `.decode()`
|
||||
|
||||
## [0.2.0] - 2019-12-10
|
||||
|
||||
|
@ -27,8 +27,7 @@ impl Decoder for BytesCodec {
|
||||
if src.is_empty() {
|
||||
Ok(None)
|
||||
} else {
|
||||
let len = src.len();
|
||||
Ok(Some(src.split_to(len)))
|
||||
Ok(Some(src.split()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user