Fix panic in FromIterator for BytesMut

This commit is contained in:
Carl Lerche
2018-05-11 08:45:04 -07:00
parent ef09e98fbc
commit b68fa46e3d
2 changed files with 22 additions and 0 deletions
+1
View File
@@ -869,6 +869,7 @@ impl FromIterator<u8> for BytesMut {
let mut out = BytesMut::with_capacity(maybe_max.unwrap_or(min));
for i in iter {
out.reserve(1);
out.put(i);
}