summary refs log tree commit diff stats
path: root/src/config_file.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-03-31 21:57:01 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-03-31 21:57:01 +0200
commit2e5e4b5736c446198e36760e254b7c17dd987166 (patch)
treeb74915864a2c80dbc0a0ebe26a52140a934f45c5 /src/config_file.rs
parentdocs(example): Add an example directory (diff)
downloadlpm-2e5e4b5736c446198e36760e254b7c17dd987166.tar.gz
lpm-2e5e4b5736c446198e36760e254b7c17dd987166.zip
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.
Diffstat (limited to 'src/config_file.rs')
-rw-r--r--src/config_file.rs19
1 files changed, 19 insertions, 0 deletions
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
+}