summary refs log tree commit diff stats
path: root/src/new/chapter.rs
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-06-18 16:43:49 +0200
committerSoispha <soispha@vhack.eu>2023-06-18 16:43:49 +0200
commit6bc393444d415d50144b2c213812ce57eae1c01f (patch)
tree4f8785367b2396d07e878f3b0e80096accd015ae /src/new/chapter.rs
parentFix(cli): Remove project option (diff)
downloadlpm-6bc393444d415d50144b2c213812ce57eae1c01f.tar.gz
lpm-6bc393444d415d50144b2c213812ce57eae1c01f.zip
Style(treewide): Format
Diffstat (limited to 'src/new/chapter.rs')
-rw-r--r--src/new/chapter.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/new/chapter.rs b/src/new/chapter.rs
index 9cc12d0..88f2a85 100644
--- a/src/new/chapter.rs
+++ b/src/new/chapter.rs
@@ -9,7 +9,6 @@ use crate::data::Data;
 
 use super::{get_project_root, CHAPTER};
 
-
 pub fn generate_new_chapter(name: String) -> io::Result<()> {
     let project_root = get_project_root().unwrap();
 
@@ -22,10 +21,14 @@ pub fn generate_new_chapter(name: String) -> io::Result<()> {
         "content/{}/chapter_{:02}.tex",
         name.to_case(Case::Snake),
         data_file.last_chapter.number + 1
-    ))).unwrap();
-    new_chapter.write_all(CHAPTER.replace("REPLACEMENT_CHAPTER", &name).as_bytes()).unwrap();
+    )))
+    .unwrap();
+    new_chapter
+        .write_all(CHAPTER.replace("REPLACEMENT_CHAPTER", &name).as_bytes())
+        .unwrap();
 
-    fs::create_dir(project_root.join(format!("content/{}/sections", name.to_case(Case::Snake),))).unwrap();
+    fs::create_dir(project_root.join(format!("content/{}/sections", name.to_case(Case::Snake),)))
+        .unwrap();
 
     main_file = main_file.replace(
         &format!(
@@ -55,7 +58,8 @@ pub fn generate_new_chapter(name: String) -> io::Result<()> {
     fs::write(
         project_root.join("lpm.toml"),
         toml::to_string(&data_file).expect("We changed it ourselfes, the conversion should work"),
-    ).unwrap();
+    )
+    .unwrap();
 
     fs::write(project_root.join("main.tex"), main_file).unwrap();