Merge pull request #1560 from joshrotenberg/clippy_path_fixes

clippy: PathBuf to Path fixes.
This commit is contained in:
Eric Huss 2021-06-01 10:12:08 -07:00 committed by GitHub
commit e9e889f523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ pub fn execute(args: &ArgMatches) -> Result<()> {
Ok(())
}
fn remove_ignored_files(book_root: &PathBuf, paths: &[PathBuf]) -> Vec<PathBuf> {
fn remove_ignored_files(book_root: &Path, paths: &[PathBuf]) -> Vec<PathBuf> {
if paths.is_empty() {
return vec![];
}
@ -81,7 +81,7 @@ fn remove_ignored_files(book_root: &PathBuf, paths: &[PathBuf]) -> Vec<PathBuf>
}
}
fn find_gitignore(book_root: &PathBuf) -> Option<PathBuf> {
fn find_gitignore(book_root: &Path) -> Option<PathBuf> {
book_root
.ancestors()
.map(|p| p.join(".gitignore"))

View File

@ -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"),

View File

@ -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<String, serde_json::Value>,
) -> Result<()> {