auto merge of #13399 : SimonSapin/rust/patch-8, r=cmr
This commit is contained in:
commit
8801d891c4
@ -237,7 +237,7 @@ impl<'a> BufWriter<'a> {
|
||||
|
||||
impl<'a> Writer for BufWriter<'a> {
|
||||
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
|
||||
// raises a condition if the entire write does not fit in the buffer
|
||||
// return an error if the entire write does not fit in the buffer
|
||||
let max_size = self.buf.len();
|
||||
if self.pos >= max_size || (self.pos + buf.len()) > max_size {
|
||||
return Err(IoError {
|
||||
|
Loading…
x
Reference in New Issue
Block a user