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", "libc",
] ]
[[package]]
name = "once_cell"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.82" version = "1.0.82"
@ -144,5 +138,4 @@ name = "xtask"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"argh", "argh",
"once_cell",
] ]

View file

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

View file

@ -1,5 +1,5 @@
use { use {
crate::{utils::IterExt, ROOT}, crate::utils::IterExt,
argh::FromArgs, argh::FromArgs,
std::{ std::{
fs::File, fs::File,
@ -17,8 +17,10 @@ pub struct Command {
} }
pub fn command(args: Command) -> io::Result<()> { pub fn command(args: Command) -> io::Result<()> {
let mut file = let mut file = File::options()
File::options().read(true).write(true).open(ROOT.join("hbbytecode/instructions.in"))?; .read(true)
.write(true)
.open(crate::root().join("hbbytecode/instructions.in"))?;
// Extract records // Extract records
let reader = BufReader::new(&file); let reader = BufReader::new(&file);

View file

@ -3,11 +3,12 @@ mod utils;
use { use {
argh::FromArgs, argh::FromArgs,
once_cell::sync::Lazy,
std::{io, path::Path}, 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 /// xTask for Holey Bytes project
#[derive(FromArgs)] #[derive(FromArgs)]