cover/src/main.rs

21 lines
587 B
Rust

use nanoserde::DeJson;
use std::{env, fs};
mod library;
fn main() {
let file_path = env::args()
.nth(1)
.expect("Usage: cover path/to/library.json");
let json = fs::read_to_string(file_path).expect("Failed to open library file");
let library: library::Library =
DeJson::deserialize_json(&json).expect("Failed to deserialize library file");
for cover in library.find_covers() {
println!("Found cover!");
println!(
"{}, by {:?}, covered by {}",
cover.title, cover.writers, cover.performer
)
}
}