/// Run souffle/plan-choice.dl to output a single plan
Run souffle/plan-choice.dl to output a single plan
Run souffle / plan - choice . dl to output a single plan
fn souffle_choice(cli: &ArgMatches) -> Result<()> {
    std::fs::remove_file("output/souffle-plan-choice.tsv").unwrap_or(());
    std::fs::remove_file("output/souffle-plan-choice-min.tsv").unwrap_or(());
    let fp = if cli.is_present("min") {
        "output/souffle-plan-choice-min.tsv"
    } else {
        "output/souffle-plan-choice.tsv"
    };
    let status = run_souffle_cmd("souffle/plan-choice.dl")?;
    ensure!(status.success(), "failed to run souffle");
    let mut stops = csv::ReaderBuilder::new()
        .has_headers(false)
        .delimiter(b'\t')
        .from_path(fp)?
        .into_deserialize()
        .collect::<Result<Vec<ParkStop>, _>>()?;
    stops.sort_unstable_by(|a, b| a.stop_ix.cmp(&b.stop_ix));
    ensure!(
        stops.len() > 1,
        "No road trip found for the given constraints. Try using --enumerate"
    );
    print_stops(stops)
}
fn souffle_choice ( cli : & ArgMatches ) -> Result < ( ) > { std :: fs :: remove_file ( " " ) . unwrap_or ( ( ) ) ; std :: fs :: remove_file ( " " ) . unwrap_or ( ( ) ) ; let fp = if cli . is_present ( " " ) { " " } else { " " } ; let status = run_souffle_cmd ( " " ) ? ; ensure ! ( status success ( ) " " ) ; let mut stops = csv :: ReaderBuilder :: new ( ) . has_headers ( false ) . delimiter ( b'\t' ) . from_path ( fp ) ? . into_deserialize ( ) . collect :: < Result < Vec < ParkStop > , _ > > ( ) ? ; stops . sort_unstable_by ( | a , b | a . stop_ix . cmp ( & b . stop_ix ) ) ; ensure ! ( stops len ( ) 1 " " ) ; print_stops ( stops ) }
Run souffle/plan-choice.dl to output a single plan
Run souffle / plan - choice . dl to output a single plan
cli
&ArgMatches