use serde::Deserialize; use std::fs; #[derive(Deserialize, Debug)] pub struct Config { pub title: String, pub url: String, pub author: String, } pub fn parse_file(filename: &str) { let contents = fs::read_to_string(filename) .expect("something went wrong reading to file"); let config: Config = toml::from_str(&contents) .expect("failed to parse toml formatting"); }