diff options
author | 2020-10-16 15:45:38 -0700 | |
---|---|---|
committer | 2020-10-16 15:45:38 -0700 | |
commit | ced050730c7a5f9d322c0cf9aedea67f16151e90 (patch) | |
tree | 7b3ed1687879911b55c643cb7dc1a375c1b0bc66 /src/buf/limit.rs | |
parent | 94c543f74b111e894d16faa43e4ad361b97ee87d (diff) | |
download | bytes-ced050730c7a5f9d322c0cf9aedea67f16151e90.tar.gz bytes-ced050730c7a5f9d322c0cf9aedea67f16151e90.tar.zst bytes-ced050730c7a5f9d322c0cf9aedea67f16151e90.zip |
Make BufMut an unsafe trait (#432)
Users of `BufMut` are unable to defend against incorrect implementations
of `BufMut`, this makes the trait unsafe to implement.
Fixes #329
Diffstat (limited to 'src/buf/limit.rs')
-rw-r--r-- | src/buf/limit.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buf/limit.rs b/src/buf/limit.rs index a36ecee..c6ed3c7 100644 --- a/src/buf/limit.rs +++ b/src/buf/limit.rs @@ -55,7 +55,7 @@ impl<T> Limit<T> { } } -impl<T: BufMut> BufMut for Limit<T> { +unsafe impl<T: BufMut> BufMut for Limit<T> { fn remaining_mut(&self) -> usize { cmp::min(self.inner.remaining_mut(), self.limit) } |