From 2e5e4b5736c446198e36760e254b7c17dd987166 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 31 Mar 2024 21:57:01 +0200 Subject: refactor(treewide): Improve code quality by working with a FileTree The FileTree has been taken from the implementation written by my for the Trinitrix project. It alleviates the problem, where functions had to do many things themselves. --- src/config_file.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/config_file.rs (limited to 'src/config_file.rs') diff --git a/src/config_file.rs b/src/config_file.rs new file mode 100644 index 0000000..838a78d --- /dev/null +++ b/src/config_file.rs @@ -0,0 +1,19 @@ +use serde_derive::{Deserialize, Serialize}; + +#[derive(Deserialize, Serialize)] +pub struct Config { + pub last_chapter: LastChapter, + pub templates: Template, +} + +#[derive(Deserialize, Serialize)] +pub struct LastChapter { + pub user_name: String, + pub number: u32, +} + +#[derive(Deserialize, Serialize)] +pub struct Template { + pub section: String, + pub chapter: String +} -- cgit 1.4.1