Skip to content

Commit

Permalink
fix errors on non-existing build dir
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoczim committed Sep 7, 2023
1 parent 9f46995 commit 0dffc86
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
26 changes: 26 additions & 0 deletions src/render/combinators.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use super::{Format, Render};
use crate::component::Component;
use std::path::Component;

pub trait RenderExt<W>: Render<W> + Sized
where
W: Format + ?Sized,
{
fn then<R>(self, next: R) -> Then<Self, R>
where
R: Render<W>;
}

#[derive(Debug, Clone)]
pub struct Then<R, S> {
first: R,
second: S,
}

impl<R, S> Component for Then<R, S>
where
R: Component,
S: Component<Kind = R::Kind>,
{
type Kind = R::Kind;
}
6 changes: 2 additions & 4 deletions src/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ where
let source = resource_dir;
let mut internal_path = InternalPath::default();

fs::remove_dir_all(&dest).map_err(|cause| BuildError {
path: internal_path.clone(),
cause,
})?;
let _ = fs::remove_dir_all(&dest)
.map_err(|cause| BuildError { path: internal_path.clone(), cause });

let mut operations =
vec![Operation::Build(Entry::Directory(&self.root))];
Expand Down

0 comments on commit 0dffc86

Please sign in to comment.