blob: bfffd54eac5c434efffba139befae8b5128e6ab8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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");
}
|