1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 09:36:39 +02:00

better SharedBytes usage for h2

This commit is contained in:
Nikolay Kim
2017-12-14 20:48:31 -08:00
parent 2b0994e448
commit 106f43e874
6 changed files with 25 additions and 16 deletions

View File

@@ -99,6 +99,10 @@ impl Drop for SharedBytes {
impl SharedBytes {
pub fn empty() -> Self {
SharedBytes(None, None)
}
pub fn new(bytes: Rc<BytesMut>, pool: Rc<SharedBytesPool>) -> SharedBytes {
SharedBytes(Some(bytes), Some(pool))
}