From fd64968f3ad481355b415238d0566e91c1a34758 Mon Sep 17 00:00:00 2001 From: mlokr Date: Mon, 8 Jul 2024 07:27:40 +0200 Subject: [PATCH] more garbage --- Cargo.lock | 7 ------- xtask/Cargo.toml | 1 - xtask/src/fmt.rs | 8 +++++--- xtask/src/main.rs | 5 +++-- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d6e0db..b2d411d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,12 +78,6 @@ dependencies = [ "libc", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.82" @@ -144,5 +138,4 @@ name = "xtask" version = "0.1.0" dependencies = [ "argh", - "once_cell", ] diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index a8494b7..ee26fcb 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -5,4 +5,3 @@ edition = "2021" [dependencies] argh = "0.1" -once_cell = "1.18" diff --git a/xtask/src/fmt.rs b/xtask/src/fmt.rs index 4be107a..18a8c4a 100644 --- a/xtask/src/fmt.rs +++ b/xtask/src/fmt.rs @@ -1,5 +1,5 @@ use { - crate::{utils::IterExt, ROOT}, + crate::utils::IterExt, argh::FromArgs, std::{ fs::File, @@ -17,8 +17,10 @@ pub struct Command { } pub fn command(args: Command) -> io::Result<()> { - let mut file = - File::options().read(true).write(true).open(ROOT.join("hbbytecode/instructions.in"))?; + let mut file = File::options() + .read(true) + .write(true) + .open(crate::root().join("hbbytecode/instructions.in"))?; // Extract records let reader = BufReader::new(&file); diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 0fc50f7..988a66f 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -3,11 +3,12 @@ mod utils; use { argh::FromArgs, - once_cell::sync::Lazy, std::{io, path::Path}, }; -static ROOT: Lazy<&Path> = Lazy::new(|| Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap()); +fn root() -> &'static Path { + Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap() +} /// xTask for Holey Bytes project #[derive(FromArgs)]