From bd1cecccfa262b2703a171f0842dd91f3400b635 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 7 Oct 2025 05:34:03 -0700 Subject: [PATCH] xtask: reduce `fs` imports --- xtask/src/run.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 0a33ce3e..ca77d133 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -1,7 +1,7 @@ use std::{ ffi::OsString, fmt::Write as _, - fs::{OpenOptions, copy, create_dir_all}, + fs::{self, OpenOptions}, io::{BufRead as _, BufReader, Write as _}, ops::Deref as _, path::{Path, PathBuf}, @@ -232,7 +232,7 @@ pub(crate) fn run(opts: Options) -> Result<()> { // // The end. - create_dir_all(&cache_dir).context("failed to create cache dir")?; + fs::create_dir_all(&cache_dir).context("failed to create cache dir")?; let gen_init_cpio = cache_dir.join("gen_init_cpio"); { @@ -471,7 +471,7 @@ pub(crate) fn run(opts: Options) -> Result<()> { for (name, binary) in binaries { let name = format!("{profile}-{name}"); let path = tmp_dir.path().join(&name); - copy(&binary, &path).with_context(|| { + fs::copy(&binary, &path).with_context(|| { format!("copy({}, {}) failed", binary.display(), path.display()) })?; let out_path = Path::new("/bin").join(&name);