Skip to content

Commit

Permalink
Drop use of openat-ext, Rust std now has efficient std::io::copy
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Feb 15, 2022
1 parent 90eed71 commit 9571863
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
22 changes: 0 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ ignition-config = "0.2"
lazy_static = "^1.4"
libc = "^0.2"
nix = ">= 0.22, < 0.24"
openat-ext = ">= 0.1.4, < 0.3"
openssl = "^0.10"
pipe = ">= 0.3, < 0.5"
regex = ">= 1.4, < 1.6"
Expand Down
5 changes: 1 addition & 4 deletions src/live/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

use anyhow::{bail, Context, Result};
use nix::unistd::isatty;
use openat_ext::FileExt;
use std::fs::{write, File, OpenOptions};
use std::io::{self, copy, BufWriter, Seek, SeekFrom, Write};
use std::os::unix::io::AsRawFd;
Expand Down Expand Up @@ -62,9 +61,7 @@ pub(super) fn write_live_iso(
.tempfile_in(output_dir)
.context("creating temporary file")?;
input.seek(SeekFrom::Start(0)).context("seeking input")?;
input
.copy_to(output.as_file_mut())
.context("copying input to temporary file")?;
copy(input, output.as_file_mut()).context("copying input to temporary file")?;
iso.write(output.as_file_mut())?;
output
.persist_noclobber(&output_path)
Expand Down

0 comments on commit 9571863

Please sign in to comment.