1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 01:11:07 +01:00

Simplify bcodec decode (#162)

This commit is contained in:
Juan Aguilar 2020-07-20 14:09:24 +00:00 committed by GitHub
parent 8d0bd7ce1c
commit 5d6d309e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -4,6 +4,7 @@
* Use `.advance()` instead of `.split_to()`. * Use `.advance()` instead of `.split_to()`.
* Upgrade `tokio-util` to `0.3`. * Upgrade `tokio-util` to `0.3`.
* Improve `BytesCodec` `.encode()` performance * Improve `BytesCodec` `.encode()` performance
* Simplify `BytesCodec` `.decode()`
## [0.2.0] - 2019-12-10 ## [0.2.0] - 2019-12-10

View File

@ -27,8 +27,7 @@ impl Decoder for BytesCodec {
if src.is_empty() { if src.is_empty() {
Ok(None) Ok(None)
} else { } else {
let len = src.len(); Ok(Some(src.split()))
Ok(Some(src.split_to(len)))
} }
} }
} }