From 6e12c1e97437ed435de5b05a98db5afebab5ae76 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 16 May 2024 10:56:00 +0200 Subject: [PATCH] fix clippy and nightly build --- asyncgit/src/lib.rs | 3 ++- filetreelist/src/lib.rs | 9 ++++++--- git2-hooks/src/error.rs | 8 ++------ git2-hooks/src/lib.rs | 2 -- git2-testing/src/lib.rs | 4 ++-- scopetime/src/lib.rs | 6 +----- src/main.rs | 3 ++- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/asyncgit/src/lib.rs b/asyncgit/src/lib.rs index dc75de9d..50b3d820 100644 --- a/asyncgit/src/lib.rs +++ b/asyncgit/src/lib.rs @@ -22,7 +22,8 @@ #![allow( clippy::module_name_repetitions, clippy::must_use_candidate, - clippy::missing_errors_doc + clippy::missing_errors_doc, + clippy::empty_docs )] //TODO: #![allow( diff --git a/filetreelist/src/lib.rs b/filetreelist/src/lib.rs index 8a72deb1..5504efb2 100644 --- a/filetreelist/src/lib.rs +++ b/filetreelist/src/lib.rs @@ -15,9 +15,12 @@ #![deny(clippy::panic)] #![deny(clippy::match_like_matches_macro)] #![deny(clippy::needless_update)] -#![allow(clippy::module_name_repetitions)] -#![allow(clippy::must_use_candidate)] -#![allow(clippy::missing_errors_doc)] +#![allow( + clippy::module_name_repetitions, + clippy::must_use_candidate, + clippy::missing_errors_doc, + clippy::empty_docs +)] mod error; mod filetree; diff --git a/git2-hooks/src/error.rs b/git2-hooks/src/error.rs index e088dfd4..dd88440b 100644 --- a/git2-hooks/src/error.rs +++ b/git2-hooks/src/error.rs @@ -1,24 +1,20 @@ use thiserror::Error; -/// +/// crate specific error type #[derive(Error, Debug)] pub enum HooksError { - /// #[error("git error:{0}")] Git(#[from] git2::Error), - /// #[error("io error:{0}")] Io(#[from] std::io::Error), - /// #[error("path string conversion error")] PathToString, - /// #[error("shellexpand error:{0}")] ShellExpand(#[from] shellexpand::LookupError), } -/// +/// crate specific `Result` type pub type Result = std::result::Result; diff --git a/git2-hooks/src/lib.rs b/git2-hooks/src/lib.rs index 21375540..43e5e18f 100644 --- a/git2-hooks/src/lib.rs +++ b/git2-hooks/src/lib.rs @@ -46,7 +46,6 @@ pub const HOOK_PREPARE_COMMIT_MSG: &str = "prepare-commit-msg"; const HOOK_COMMIT_MSG_TEMP_FILE: &str = "COMMIT_EDITMSG"; -/// #[derive(Debug, PartialEq, Eq)] pub enum HookResult { /// No hook found @@ -171,7 +170,6 @@ pub fn hooks_post_commit( hook.run_hook(&[]) } -/// pub enum PrepareCommitMsgSource { Message, Template, diff --git a/git2-testing/src/lib.rs b/git2-testing/src/lib.rs index 7628dcb8..e8ca8747 100644 --- a/git2-testing/src/lib.rs +++ b/git2-testing/src/lib.rs @@ -1,7 +1,7 @@ use git2::Repository; use tempfile::TempDir; -/// +/// initialize test repo in temp path pub fn repo_init_empty() -> (TempDir, Repository) { init_log(); @@ -18,7 +18,7 @@ pub fn repo_init_empty() -> (TempDir, Repository) { (td, repo) } -/// +/// initialize test repo in temp path with an empty first commit pub fn repo_init() -> (TempDir, Repository) { init_log(); diff --git a/scopetime/src/lib.rs b/scopetime/src/lib.rs index 0cf774b5..b145f25a 100644 --- a/scopetime/src/lib.rs +++ b/scopetime/src/lib.rs @@ -1,14 +1,12 @@ //! simple macro to insert a scope based runtime measure that logs the result #![forbid(unsafe_code)] -#![forbid(missing_docs)] #![deny(unused_imports)] #![deny(clippy::unwrap_used)] #![deny(clippy::perf)] use std::time::Instant; -/// pub struct ScopeTimeLog<'a> { title: &'a str, mod_path: &'a str, @@ -17,9 +15,7 @@ pub struct ScopeTimeLog<'a> { time: Instant, } -/// impl<'a> ScopeTimeLog<'a> { - /// pub fn new( mod_path: &'a str, title: &'a str, @@ -49,7 +45,7 @@ impl<'a> Drop for ScopeTimeLog<'a> { } } -/// +/// measures runtime of scope and prints it into log #[cfg(feature = "enabled")] #[macro_export] macro_rules! scope_time { diff --git a/src/main.rs b/src/main.rs index 26093811..a5dc1039 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,8 @@ #![allow( clippy::multiple_crate_versions, clippy::bool_to_int_with_if, - clippy::module_name_repetitions + clippy::module_name_repetitions, + clippy::empty_docs )] //TODO: