Remove smush rules, fix warnings

This commit is contained in:
Piv
2023-03-09 18:58:54 +10:30
parent 540e4c778d
commit 887e7c950b
6 changed files with 23 additions and 84 deletions

View File

@@ -1,8 +1,6 @@
use std::{collections::HashMap, error::Error, io::Write, path::PathBuf};
use std::path::PathBuf;
use clap::{Parser, Subcommand};
use coster_rs::CsvCost;
use serde::Deserialize;
#[derive(Parser)]
#[command(name = "coster-rs")]
@@ -17,7 +15,7 @@ struct Cli {
#[derive(Subcommand)]
enum Commands {
/// Moves money between accounts and departments, using the given rules and lines
move_money {
MoveMoney {
#[arg(short = 'r', long, value_name = "FILE")]
rules: PathBuf,
@@ -39,16 +37,8 @@ enum Commands {
#[arg(short, long)]
flush_pass: bool,
},
/// Combines rules to the minimum set required
smush_rules {
#[arg(short = 'r', long, value_name = "FILE")]
rules: PathBuf,
#[arg(short, long, value_name = "FILE")]
output: Option<PathBuf>,
},
/// Allocates servicing department amounts to operating departments
allocate_overheads {
AllocateOverheads {
#[arg(short, long, value_name = "FILE")]
lines: PathBuf,
@@ -79,7 +69,7 @@ fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
match cli.command {
Commands::move_money {
Commands::MoveMoney {
rules,
lines,
accounts,
@@ -96,8 +86,7 @@ fn main() -> anyhow::Result<()> {
use_numeric_accounts,
flush_pass,
),
Commands::smush_rules { rules, output } => smush_rules(rules, output),
Commands::allocate_overheads {
Commands::AllocateOverheads {
lines,
accounts,
allocation_statistics,
@@ -139,10 +128,6 @@ fn move_money(
)
}
fn smush_rules(rules_path: PathBuf, output: Option<PathBuf>) -> anyhow::Result<()> {
Ok(())
}
fn allocate_overheads(
lines: PathBuf,
accounts: PathBuf,
@@ -166,11 +151,3 @@ fn allocate_overheads(
account_type,
)
}
#[derive(Debug, Deserialize)]
struct CsvOverheadAllocationRule {
from_overhead_department: String,
to_department: String,
percent: f64,
to_department_type: String,
}