Skip to content

Commit

Permalink
lbf prints clickable links to solution files
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenGar committed Feb 28, 2024
1 parent c29ae96 commit 97c6dde
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lbf/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use std::fs::File;
use std::io::{BufReader, BufWriter};
use std::path::Path;

use log::{info, log, Level, LevelFilter};
use log::{info, Level, LevelFilter, log};
use svg::Document;

use jagua_rs::io::json_instance::JsonInstance;

use crate::io::json_output::JsonOutput;
use crate::EPOCH;
use crate::io::json_output::JsonOutput;

pub mod cli;
pub mod json_output;
Expand All @@ -35,16 +35,22 @@ pub fn write_json_output(json_output: &JsonOutput, path: &Path) {
.unwrap_or_else(|_| panic!("could not write solution file: {}", path.display()));

info!(
"Solution JSON written to {:?}",
fs::canonicalize(path).expect("could not canonicalize path")
"Solution JSON written to file://{}",
fs::canonicalize(path)
.expect("could not canonicalize path")
.to_str()
.unwrap()
);
}

pub fn write_svg(document: &Document, path: &Path) {
svg::save(path, document).expect("failed to write svg file");
info!(
"Solution SVG written to {:?}",
fs::canonicalize(&path).expect("could not canonicalize path")
"Solution SVG written to file://{}",
fs::canonicalize(&path)
.expect("could not canonicalize path")
.to_str()
.unwrap()
);
}

Expand Down

0 comments on commit 97c6dde

Please sign in to comment.