Skip to content

Commit

Permalink
Fix Writing by calling flush on Bufwriter
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Jan 29, 2021
1 parent eae785b commit 69b8022
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lazrs"
version = "0.2.4"
version = "0.2.5"
authors = ["tmontaigu <[email protected]>"]
edition = "2018"
license = "MIT"
Expand All @@ -12,7 +12,7 @@ name = "lazrs"
crate-type = ["cdylib"]

[dependencies.laz]
version = "0.5.1"
version = "0.5.2"
features = ["parallel"]

[dependencies.pyo3]
Expand Down
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use pyo3::types::{PyAny, PyType, PyBytes};
use pyo3::{create_exception, wrap_pyfunction};

use crate::adapters::{PyReadableFileObject, PyWriteableFileObject};
use std::io::{BufReader, BufWriter};
use std::io::{BufReader, BufWriter, Write};

mod adapters;

Expand Down Expand Up @@ -118,7 +118,8 @@ impl ParLasZipCompressor {
}

fn done(&mut self) -> PyResult<()> {
self.compressor.done().map_err(into_py_err)
self.compressor.done().map_err(into_py_err)?;
self.compressor.get_mut().flush().map_err(into_py_err)
}
}

Expand Down Expand Up @@ -218,7 +219,8 @@ impl LasZipCompressor {
}

pub fn done(&mut self) -> PyResult<()> {
self.compressor.done().map_err(into_py_err)
self.compressor.done().map_err(into_py_err)?;
self.compressor.get_mut().flush().map_err(into_py_err)
}
}

Expand Down

0 comments on commit 69b8022

Please sign in to comment.