From 33eac07b1a2d4b18df23b1895386fc6fe294adfe Mon Sep 17 00:00:00 2001 From: Nick Groenen Date: Tue, 27 Jul 2021 15:00:44 +0200 Subject: [PATCH] Fix 4 new clippy lints --- src/context.rs | 4 ++-- src/lib.rs | 2 +- src/main.rs | 2 +- src/references.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/context.rs b/src/context.rs index 1b72abd..9b15942 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,5 +1,5 @@ use crate::Frontmatter; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; #[derive(Debug, Clone)] /// Context holds metadata about a note which is being parsed. @@ -55,7 +55,7 @@ impl Context { } /// Create a new `Context` which inherits from a parent Context. - pub fn from_parent(context: &Context, child: &PathBuf) -> Context { + pub fn from_parent(context: &Context, child: &Path) -> Context { let mut context = context.clone(); context.file_tree.push(child.to_path_buf()); context diff --git a/src/lib.rs b/src/lib.rs index fe6616e..86c6cf8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -317,7 +317,7 @@ impl<'a> Exporter<'a> { self.destination.clone() } }; - return Ok(self.export_note(&self.root, &destination)?); + return self.export_note(&self.root, &destination); } if !self.destination.exists() { diff --git a/src/main.rs b/src/main.rs index 24eca47..9fb3152 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ use gumdrop::Options; use obsidian_export::{ExportError, Exporter, FrontmatterStrategy, WalkOptions}; use std::{env, path::PathBuf}; -const VERSION: &'static str = env!("CARGO_PKG_VERSION"); +const VERSION: &str = env!("CARGO_PKG_VERSION"); #[derive(Debug, Options)] struct Opts { diff --git a/src/references.rs b/src/references.rs index 7e459db..e2ffc9f 100644 --- a/src/references.rs +++ b/src/references.rs @@ -79,8 +79,8 @@ impl<'a> ObsidianNoteReference<'a> { ObsidianNoteReference { file, - label, section, + label, } }