Skip to content

Commit

Permalink
buffer: Add Clone + Copy impls for BufferLayer (#493)
Browse files Browse the repository at this point in the history
It's generally the case that layers need to be shareable. There's no
reason that `BufferLayer` should not implement both `Clone` and `Copy`.

This change adds manual `Clone` and `Copy` implementations for
`BufferLayer`.
  • Loading branch information
olix0r committed Dec 28, 2020
1 parent 4f65e30 commit ff85e3a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tower/src/buffer/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,14 @@ impl<Request> fmt::Debug for BufferLayer<Request> {
.finish()
}
}

impl<Request> Clone for BufferLayer<Request> {
fn clone(&self) -> Self {
Self {
bound: self.bound,
_p: self._p,
}
}
}

impl<Request> Copy for BufferLayer<Request> {}

0 comments on commit ff85e3a

Please sign in to comment.