Skip to content

Commit

Permalink
huge refactor complete
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtbuilds committed Sep 16, 2024
1 parent 56cb5a8 commit bce22cc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
6 changes: 4 additions & 2 deletions codegen_rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ pub fn generate_rust_library(spec: HirSpec, cfg: Config) -> Result<()> {
}

fn remove_old_files(dest: &Path, modified: &HashSet<PathBuf>) -> Result<()> {
let mut to_delete: Vec<_> = fs::read_dir(dest.join("examples"))?
.chain(fs::read_dir(dest.join("src"))?)
let mut to_delete: Vec<_> = fs::read_dir(dest.join("examples"))
.into_iter()
.flatten()
.chain(fs::read_dir(dest.join("src")).into_iter().flatten())
.flat_map(|e| e.ok())
.map(|e| e.path())
.filter(|e| e.ends_with(".rs"))
Expand Down
13 changes: 1 addition & 12 deletions libninja/src/bin/libninja.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
use anyhow::Result;
use clap::{Args, Parser, Subcommand};
use clap::{Parser, Subcommand};
use libninja::command::*;
use tracing::Level;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;

fn warn_if_not_found(command: &str) {
if std::process::Command::new(command)
.stderr(std::process::Stdio::null())
.stdout(std::process::Stdio::null())
.spawn()
.is_err()
{
eprintln!("Warning: {} not found. Some commands may fail.", command);
}
}

#[derive(Parser, Debug)]
#[command(author, version, about)]
struct Cli {
Expand Down
5 changes: 3 additions & 2 deletions libninja/tests/static/plaid_processor_expected.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use plaid::PlaidClient;
#![allow(unused_imports)]
use plaid::model::*;
use plaid::PlaidClient;
#[tokio::main]
async fn main() {
let client = PlaidClient::from_env();
Expand All @@ -21,4 +22,4 @@ async fn main() {
.await
.unwrap();
println!("{:#?}", response);
}
}
5 changes: 3 additions & 2 deletions libninja/tests/static/plaid_watchlist_expected.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use plaid::PlaidClient;
#![allow(unused_imports)]
use plaid::model::*;
use plaid::PlaidClient;
#[tokio::main]
async fn main() {
let client = PlaidClient::from_env();
Expand All @@ -16,4 +17,4 @@ async fn main() {
.await
.unwrap();
println!("{:#?}", response);
}
}

0 comments on commit bce22cc

Please sign in to comment.