Skip to content

Commit

Permalink
Prepare pages into a Box
Browse files Browse the repository at this point in the history
  • Loading branch information
grego committed Jul 14, 2021
1 parent 2d4e9bc commit 41a7432
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ impl<'p> Page<'p> {
/// Appropriately sort the given vector of pages and create all the directories where
/// they will be rendered to.
#[inline]
pub fn prepare(mut pages: Vec<Self>, config: &Config) -> Result<Vec<Self>, io::Error> {
pub fn prepare(mut pages: Vec<Self>, config: &Config) -> Result<Box<[Self]>, io::Error> {
let output_dir = Path::new(config.output_dir.as_ref());
for i in 0..pages.len() {
let page = &pages[i];
Expand Down Expand Up @@ -343,7 +343,7 @@ impl<'p> Page<'p> {
pages[i].id = i;
}

Ok(pages)
Ok(pages.into())
}

/// Get a reference of the page, in context of its subpages and subsections.
Expand Down

0 comments on commit 41a7432

Please sign in to comment.