add empty-ish config struct
parent
da496e7110
commit
bd66ccad02
|
@ -2,6 +2,8 @@ use std::path::Path;
|
|||
use zettel::*;
|
||||
|
||||
fn main() {
|
||||
// println!("{:#?}", Config::load());
|
||||
|
||||
match Zettel::in_dir(Path::new("demo")) {
|
||||
Ok(zettels) => println!(
|
||||
"{}",
|
||||
|
|
32
src/lib.rs
32
src/lib.rs
|
@ -5,6 +5,38 @@ use std::io::ErrorKind;
|
|||
use std::io::*;
|
||||
use std::path::Path;
|
||||
|
||||
// CONFIG
|
||||
|
||||
pub struct Config {
|
||||
sources: Vec<Source>,
|
||||
}
|
||||
|
||||
pub struct Source {
|
||||
pub path: std::path::PathBuf,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn load() -> Result<Config> {
|
||||
Ok(Config {
|
||||
sources: Vec::new(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Config {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Config")
|
||||
.field("sources", &self.sources)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Source {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Source").field("path", &self.path).finish()
|
||||
}
|
||||
}
|
||||
|
||||
// ZETTEL
|
||||
|
||||
pub struct Zettel {
|
||||
|
|
Reference in New Issue