Skip to content

Commit 5d85278

Browse files
committed
buf writes to components
1 parent a4dd7d0 commit 5d85278

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/dist/component/components.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//! `Components` and `DirectoryPackage` are the two sides of the
33
//! installation / uninstallation process.
44
5+
use std::io::BufWriter;
56
use std::path::{Path, PathBuf};
67

78
use anyhow::{bail, Result};
@@ -122,7 +123,7 @@ impl<'a> ComponentBuilder<'a> {
122123
// Write component manifest
123124
let path = self.components.rel_component_manifest(&self.name);
124125
let abs_path = self.components.prefix.abs_path(&path);
125-
let mut file = self.tx.add_file(&self.name, path)?;
126+
let mut file = BufWriter::new(self.tx.add_file(&self.name, path)?);
126127
for part in self.parts {
127128
// FIXME: This writes relative paths to the component manifest,
128129
// but rust-installer writes absolute paths.

src/utils/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub(crate) fn append_file(name: &'static str, path: &Path, line: &str) -> Result
6464

6565
pub(crate) fn write_line(
6666
name: &'static str,
67-
file: &mut File,
67+
mut file: impl Write,
6868
path: &Path,
6969
line: &str,
7070
) -> Result<()> {

0 commit comments

Comments
 (0)