From 6bc393444d415d50144b2c213812ce57eae1c01f Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 18 Jun 2023 16:43:49 +0200 Subject: Style(treewide): Format --- src/new/chapter.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/new/chapter.rs') 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(); -- cgit 1.4.1