more garbage

This commit is contained in:
mlokr 2024-07-08 07:27:40 +02:00
parent e00f2f08c8
commit fd64968f3a
No known key found for this signature in database
GPG key ID: DEA147DDEE644993
4 changed files with 8 additions and 13 deletions

7
Cargo.lock generated
View file

@ -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",
]

View file

@ -5,4 +5,3 @@ edition = "2021"
[dependencies]
argh = "0.1"
once_cell = "1.18"

View file

@ -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);

View file

@ -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)]