From 465778c196ea890253554d007f152b869563ede9 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Fri, 19 Oct 2018 08:59:45 +0200 Subject: [PATCH] Always populate sections on section change --- components/rebuild/src/lib.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/components/rebuild/src/lib.rs b/components/rebuild/src/lib.rs index dc751c7..b21b173 100644 --- a/components/rebuild/src/lib.rs +++ b/components/rebuild/src/lib.rs @@ -118,13 +118,6 @@ fn handle_section_editing(site: &mut Site, path: &Path) -> Result<()> { match site.add_section(section, true)? { // Updating a section Some(prev) => { - // Copy the section data so we don't end up with an almost empty object - { - let s = site.library.get_section_mut(&pathbuf).unwrap(); - s.pages = prev.pages; - s.ignored_pages = prev.ignored_pages; - s.subsections = prev.subsections; - } site.populate_sections(); if site.library.get_section(&pathbuf).unwrap().meta == prev.meta { @@ -144,7 +137,6 @@ fn handle_section_editing(site: &mut Site, path: &Path) -> Result<()> { SectionChangesNeeded::RenderWithPages => site.render_section(&site.library.get_section(&pathbuf).unwrap(), true)?, // not a common enough operation to make it worth optimizing SectionChangesNeeded::Delete => { - site.populate_sections(); site.build()?; } };