From 30a3205e4fb0b9f6e578621c72160df5e4b8d09b Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 3 Mar 2024 11:38:57 +0200 Subject: [PATCH] meli: Add clippy::doc_markdown Signed-off-by: Manos Pitsidianakis --- meli/config_macros.rs | 2 +- meli/src/command.rs | 2 +- meli/src/conf/overrides.rs | 2 +- meli/src/conf/themes.rs | 6 +++--- meli/src/jobs.rs | 2 +- meli/src/lib.rs | 2 ++ meli/src/mail/view/thread.rs | 12 ++++++------ meli/src/types/helpers.rs | 2 +- meli/src/utilities/dialogs.rs | 10 +++++----- 9 files changed, 21 insertions(+), 19 deletions(-) diff --git a/meli/config_macros.rs b/meli/config_macros.rs index bc1edfea..367a6c35 100644 --- a/meli/config_macros.rs +++ b/meli/config_macros.rs @@ -56,7 +56,7 @@ pub(crate) fn override_derive(filenames: &[(&str, &str)]) { #![allow(clippy::derivable_impls)] -//! This module is automatically generated by config_macros.rs. +//! This module is automatically generated by `config_macros.rs`. use super::*; use melib::HeaderName; diff --git a/meli/src/command.rs b/meli/src/command.rs index 039c7ef9..039ba2a1 100644 --- a/meli/src/command.rs +++ b/meli/src/command.rs @@ -63,7 +63,7 @@ pub use crate::actions::{ ViewAction::{self, *}, }; -/// Helper macro to convert an array of tokens into a TokenStream +/// Helper macro to convert an array of tokens into a `TokenStream` macro_rules! to_stream { ($token: expr) => { TokenStream { diff --git a/meli/src/conf/overrides.rs b/meli/src/conf/overrides.rs index ae250c66..6ede703c 100644 --- a/meli/src/conf/overrides.rs +++ b/meli/src/conf/overrides.rs @@ -22,7 +22,7 @@ #![allow(clippy::derivable_impls)] -//! This module is automatically generated by config_macros.rs. +//! This module is automatically generated by `config_macros.rs`. use super::*; use melib::HeaderName; diff --git a/meli/src/conf/themes.rs b/meli/src/conf/themes.rs index 5a4e6b90..a68393a1 100644 --- a/meli/src/conf/themes.rs +++ b/meli/src/conf/themes.rs @@ -361,17 +361,17 @@ pub enum ColorField { Bg, } -/// The field a ThemeValue::Link refers to. +/// The field a `ThemeValue::Link` refers to. trait ThemeLink { type LinkType; } -/// A color value that's a link can either refer to .fg or .bg field +/// A color value that's a link can either refer to `.fg` or `.bg` field impl ThemeLink for Color { type LinkType = ColorField; } -/// An attr value that's a link can only refer to an .attr field +/// An `attr` value that's a link can only refer to an `.attr` field impl ThemeLink for Attr { type LinkType = (); } diff --git a/meli/src/jobs.rs b/meli/src/jobs.rs index 2bc1fffc..aecc6452 100644 --- a/meli/src/jobs.rs +++ b/meli/src/jobs.rs @@ -417,7 +417,7 @@ impl JobExecutor { pub type JobChannel = oneshot::Receiver; -/// JoinHandle for the future that allows us to cancel the task. +/// `JoinHandle` for the future that allows us to cancel the task. #[derive(Debug)] pub struct JoinHandle { pub task: Arc>>>, diff --git a/meli/src/lib.rs b/meli/src/lib.rs index aea71190..41f4c0c8 100644 --- a/meli/src/lib.rs +++ b/meli/src/lib.rs @@ -40,6 +40,8 @@ //clippy::cast_lossless, //clippy::cast_possible_wrap, //clippy::ptr_as_ptr, + clippy::doc_markdown, + clippy::expect_fun_call, clippy::bool_to_int_with_if, clippy::borrow_as_ptr, clippy::cast_ptr_alignment, diff --git a/meli/src/mail/view/thread.rs b/meli/src/mail/view/thread.rs index e58fa8c4..4d3d8bba 100644 --- a/meli/src/mail/view/thread.rs +++ b/meli/src/mail/view/thread.rs @@ -32,7 +32,7 @@ use crate::components::PageMovement; #[derive(Debug)] struct ThreadEntry { index: (usize, ThreadNodeHash, usize), - /// (indentation, thread_node index, line number in listing) + /// (indentation, `thread_node` index, line number in listing) indentation: usize, msg_hash: EnvelopeHash, seen: bool, @@ -73,11 +73,11 @@ pub struct ThreadView { } impl ThreadView { - /// @coordinates: (account index, mailbox_hash, root set thread_node index) - /// @expanded_hash: optional position of expanded entry when we render the - /// ThreadView. - /// default: expanded message is the last one. - /// @context: current context + /// @`coordinates`: (account index, `mailbox_hash`, root set `thread_node` + /// index) + /// @`expanded_hash`: optional position of expanded entry when we + /// render the `ThreadView`. + /// default: expanded message is the last one. pub fn new( coordinates: (AccountHash, MailboxHash, EnvelopeHash), thread_group: ThreadHash, diff --git a/meli/src/types/helpers.rs b/meli/src/types/helpers.rs index d293b227..588379ba 100644 --- a/meli/src/types/helpers.rs +++ b/meli/src/types/helpers.rs @@ -76,7 +76,7 @@ impl File { inner(&self.path).chain_err_summary(|| format!("Can't read {}", self.path.display())) } - /// Returned `File` will be deleted when dropped if delete_on_drop is set, + /// Returned `File` will be deleted when dropped if `delete_on_drop` is set, /// so make sure to add it on `context.temp_files` to reap it later. pub fn create_temp_file( bytes: &[u8], diff --git a/meli/src/utilities/dialogs.rs b/meli/src/utilities/dialogs.rs index 83d0be0f..8f63d4ca 100644 --- a/meli/src/utilities/dialogs.rs +++ b/meli/src/utilities/dialogs.rs @@ -38,11 +38,11 @@ enum SelectorCursor { /// Shows a little window with options for user to select. /// -/// Instantiate with Selector::new(). Set single_only to true if user should +/// Instantiate with `Selector::new()`. Set `single_only` to true if user should /// only choose one of the options. After passing input events to this -/// component, check Selector::is_done to see if the user has finalised their -/// choices. Collect the choices by consuming the Selector with -/// Selector::collect() +/// component, check `Selector::is_done` to see if the user has finalised their +/// choices. Collect the choices by consuming the `Selector` with +/// `Selector::collect()` pub struct Selector< T: 'static + PartialEq + std::fmt::Debug + Clone + Sync + Send, F: 'static + Sync + Send, @@ -58,7 +58,7 @@ pub struct Selector< horizontal_alignment: Alignment, title: String, - /// If true, user has finished their selection + /// If `true`, user has finished their selection done: bool, done_fn: F, dirty: bool,