From 05edc4421bc8bf83270203446ddc52e1b4534473 Mon Sep 17 00:00:00 2001 From: josh rotenberg Date: Mon, 31 May 2021 20:27:52 -0700 Subject: [PATCH] clippy: PathBuf to Path --- src/cmd/watch.rs | 4 ++-- src/config.rs | 2 +- src/renderer/html_handlebars/hbs_renderer.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd/watch.rs b/src/cmd/watch.rs index 6d972eb5..b27516b0 100644 --- a/src/cmd/watch.rs +++ b/src/cmd/watch.rs @@ -58,7 +58,7 @@ pub fn execute(args: &ArgMatches) -> Result<()> { Ok(()) } -fn remove_ignored_files(book_root: &PathBuf, paths: &[PathBuf]) -> Vec { +fn remove_ignored_files(book_root: &Path, paths: &[PathBuf]) -> Vec { if paths.is_empty() { return vec![]; } @@ -81,7 +81,7 @@ fn remove_ignored_files(book_root: &PathBuf, paths: &[PathBuf]) -> Vec } } -fn find_gitignore(book_root: &PathBuf) -> Option { +fn find_gitignore(book_root: &Path) -> Option { book_root .ancestors() .map(|p| p.join(".gitignore")) diff --git a/src/config.rs b/src/config.rs index deae069b..c384192c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -575,7 +575,7 @@ impl Default for HtmlConfig { impl HtmlConfig { /// Returns the directory of theme from the provided root directory. If the /// directory is not present it will append the default directory of "theme" - pub fn theme_dir(&self, root: &PathBuf) -> PathBuf { + pub fn theme_dir(&self, root: &Path) -> PathBuf { match self.theme { Some(ref d) => root.join(d), None => root.join("theme"), diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 56324331..6425c9ae 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -131,7 +131,7 @@ impl HtmlHandlebars { &self, ctx: &RenderContext, html_config: &HtmlConfig, - src_dir: &PathBuf, + src_dir: &Path, handlebars: &mut Handlebars<'_>, data: &mut serde_json::Map, ) -> Result<()> {