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
This commit is contained in:
Carl Lerche
2020-10-16 15:45:38 -07:00
committed by GitHub
parent 94c543f74b
commit ced050730c
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -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)
}