Xuanwo commented on issue #6934:
URL: https://github.com/apache/arrow-rs/issues/6934#issuecomment-2569434780

   
   > Edit: more accurate version
   > 
   > ```
   > let mut writer = BufWriter::new(store, path);
   > 
   > let mut buf = vec![];
   > while something {
   >    buf.extend_from_slice(&some_data);
   > 
   >    if buf.len() > SOME_SIZE {
   >       writer.write_all(&buf).await?
   >       buf.clear();
   >    }
   > }
   > 
   > writer.flush().await?;
   > writer.shutdown().await?;
   > ```
   
   Hi, if the code here is correct, it's possible that the `buf` still have 
content after the `while` loop finished. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to