Merge pull request #1560 from joshrotenberg/clippy_path_fixes
clippy: PathBuf to Path fixes.
This commit is contained in:
commit
e9e889f523
|
@ -58,7 +58,7 @@ pub fn execute(args: &ArgMatches) -> Result<()> {
|
||||||
Ok(())
|
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() {
|
if paths.is_empty() {
|
||||||
return vec![];
|
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
|
book_root
|
||||||
.ancestors()
|
.ancestors()
|
||||||
.map(|p| p.join(".gitignore"))
|
.map(|p| p.join(".gitignore"))
|
||||||
|
|
|
@ -575,7 +575,7 @@ impl Default for HtmlConfig {
|
||||||
impl HtmlConfig {
|
impl HtmlConfig {
|
||||||
/// Returns the directory of theme from the provided root directory. If the
|
/// Returns the directory of theme from the provided root directory. If the
|
||||||
/// directory is not present it will append the default directory of "theme"
|
/// 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 {
|
match self.theme {
|
||||||
Some(ref d) => root.join(d),
|
Some(ref d) => root.join(d),
|
||||||
None => root.join("theme"),
|
None => root.join("theme"),
|
||||||
|
|
|
@ -131,7 +131,7 @@ impl HtmlHandlebars {
|
||||||
&self,
|
&self,
|
||||||
ctx: &RenderContext,
|
ctx: &RenderContext,
|
||||||
html_config: &HtmlConfig,
|
html_config: &HtmlConfig,
|
||||||
src_dir: &PathBuf,
|
src_dir: &Path,
|
||||||
handlebars: &mut Handlebars<'_>,
|
handlebars: &mut Handlebars<'_>,
|
||||||
data: &mut serde_json::Map<String, serde_json::Value>,
|
data: &mut serde_json::Map<String, serde_json::Value>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
|
Loading…
Reference in New Issue