Skip to content

Commit 240e702

Browse files
authored
use a BufWriter to write the PK (#2159)
1 parent 389ec11 commit 240e702

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pipeline/src/pipeline.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{
33
collections::HashMap,
44
fmt::Display,
55
fs,
6-
io::{self, BufReader},
6+
io::{self, BufReader, BufWriter, Write},
77
path::{Path, PathBuf},
88
rc::Rc,
99
sync::Arc,
@@ -1169,14 +1169,15 @@ impl<T: FieldElement> Pipeline<T> {
11691169
self.arguments.query_callback.as_deref()
11701170
}
11711171

1172-
pub fn export_proving_key<W: io::Write>(&mut self, mut writer: W) -> Result<(), Vec<String>> {
1172+
pub fn export_proving_key<W: io::Write>(&mut self, writer: W) -> Result<(), Vec<String>> {
11731173
let backend = self.setup_backend()?;
1174-
backend
1175-
.export_proving_key(&mut writer)
1176-
.map_err(|e| match e {
1177-
powdr_backend::Error::BackendError(e) => vec![e],
1178-
_ => panic!(),
1179-
})
1174+
let mut bw = BufWriter::new(writer);
1175+
let res = backend.export_proving_key(&mut bw).map_err(|e| match e {
1176+
powdr_backend::Error::BackendError(e) => vec![e],
1177+
_ => panic!(),
1178+
});
1179+
bw.flush().unwrap();
1180+
res
11801181
}
11811182

11821183
pub fn export_verification_key<W: io::Write>(

0 commit comments

Comments
 (0)