From 34a2d52e7ee8117f84d5177826c4d258c8dc28cd Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 17 Dec 2023 19:14:00 +0200 Subject: [PATCH] Fix rustdoc::redundant_explicit_links Signed-off-by: Manos Pitsidianakis --- meli/src/lib.rs | 2 ++ meli/src/mail/listing/thread.rs | 4 ++-- meli/src/terminal.rs | 14 ++++++++++++++ meli/src/terminal/embedded/terminal.rs | 9 ++++----- meli/src/terminal/position.rs | 17 +---------------- meli/src/terminal/screen.rs | 2 +- meli/src/types.rs | 2 +- melib/src/email.rs | 6 +++--- melib/src/email/parser.rs | 3 +-- melib/src/lib.rs | 1 + 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/meli/src/lib.rs b/meli/src/lib.rs index 5fb3cd1d..d421e850 100644 --- a/meli/src/lib.rs +++ b/meli/src/lib.rs @@ -19,6 +19,8 @@ * along with meli. If not, see . */ +#![deny(rustdoc::redundant_explicit_links)] + //! //! This crate contains the frontend stuff of the application. The application //! entry way on `src/bin.rs` creates an event loop and passes input to a diff --git a/meli/src/mail/listing/thread.rs b/meli/src/mail/listing/thread.rs index 24d838c7..971e08d5 100644 --- a/meli/src/mail/listing/thread.rs +++ b/meli/src/mail/listing/thread.rs @@ -125,8 +125,8 @@ macro_rules! row_attr { }}; } -/// A list of all mail ([`Envelope`](melib::Envelope)s) in a `Mailbox`. On `\n` -/// it opens the [`Envelope`](melib::Envelope) content in a [`MailView`]. +/// A list of all mail ([`Envelope`]s) in a `Mailbox`. On `\n` +/// it opens the [`Envelope`] content in a [`MailView`]. #[derive(Debug)] pub struct ThreadListing { /// (x, y, z): x is accounts, y is mailboxes, z is index inside a mailbox. diff --git a/meli/src/terminal.rs b/meli/src/terminal.rs index d1f20414..51026cb1 100644 --- a/meli/src/terminal.rs +++ b/meli/src/terminal.rs @@ -43,6 +43,20 @@ pub use screen::{Area, Screen, ScreenGeneration, StateStdout, Tty, Virtual}; pub use self::{cells::*, keys::*, position::*, text_editing::*}; +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub enum Alignment { + /// Stretch to fill all space if possible, center if no meaningful way to + /// stretch. + Fill, + /// Snap to left or top side, leaving space on right or bottom. + Start, + /// Snap to right or bottom side, leaving space on left or top. + End, + /// Center natural width of widget inside the allocation. + #[default] + Center, +} + /* * CSI events we use */ diff --git a/meli/src/terminal/embedded/terminal.rs b/meli/src/terminal/embedded/terminal.rs index 789365d4..9138d543 100644 --- a/meli/src/terminal/embedded/terminal.rs +++ b/meli/src/terminal/embedded/terminal.rs @@ -30,14 +30,13 @@ //! * a struct containing the PID of the child process that talks to this //! pseudoterminal. //! * a [`std::fs::File`] handle to the child process's standard input stream. -//! * an [`EmbeddedGrid`] which is a wrapper over -//! [`CellBuffer`](crate::CellBuffer) along with the properties needed to -//! maintain a proper state machine that keeps track of ongoing escape code -//! operations. +//! * an [`EmbeddedGrid`] which is a wrapper over [`CellBuffer`] along with +//! the properties needed to maintain a proper state machine that keeps +//! track of ongoing escape code operations. //! //! ## Creation //! -//! To create a [`Terminal`], see [`create_pty`](super::create_pty). +//! To create a [`Terminal`], see [`create_pty`]. use melib::{ error::{Error, Result}, diff --git a/meli/src/terminal/position.rs b/meli/src/terminal/position.rs index 0142fcb9..21ae0eb7 100644 --- a/meli/src/terminal/position.rs +++ b/meli/src/terminal/position.rs @@ -20,8 +20,7 @@ */ //! Simple type definitions and macro helper for a `(x, y)` position on the -//! terminal and the areas they define. An [`Area`] consists of two points: the -//! upper left and bottom right corners. +//! terminal and the areas they define. /// A `(x, y)` position on screen. pub type Pos = (usize, usize); @@ -51,17 +50,3 @@ pub fn pos_inc(p: Pos, inc: (usize, usize)) -> Pos { pub fn pos_dec(p: Pos, dec: (usize, usize)) -> Pos { (p.0.saturating_sub(dec.0), p.1.saturating_sub(dec.1)) } - -#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] -pub enum Alignment { - /// Stretch to fill all space if possible, center if no meaningful way to - /// stretch. - Fill, - /// Snap to left or top side, leaving space on right or bottom. - Start, - /// Snap to right or bottom side, leaving space on left or top. - End, - /// Center natural width of widget inside the allocation. - #[default] - Center, -} diff --git a/meli/src/terminal/screen.rs b/meli/src/terminal/screen.rs index c7be7098..cd97396f 100644 --- a/meli/src/terminal/screen.rs +++ b/meli/src/terminal/screen.rs @@ -27,7 +27,7 @@ use termion::{clear, cursor, raw::IntoRawMode, screen::AlternateScreen}; use crate::{ terminal::{ - cells::CellBuffer, position::*, BracketModeEnd, BracketModeStart, Cell, Color, + cells::CellBuffer, position::*, Alignment, BracketModeEnd, BracketModeStart, Cell, Color, DisableMouse, DisableSGRMouse, EnableMouse, EnableSGRMouse, RestoreWindowTitleIconFromStack, SaveWindowTitleIconToStack, }, diff --git a/meli/src/types.rs b/meli/src/types.rs index 75ed7d20..78719ac9 100644 --- a/meli/src/types.rs +++ b/meli/src/types.rs @@ -31,7 +31,7 @@ //! `vi`. //! //! [`UIEvent`] is the type passed around -//! [`Component`](crate::components::Component)'s when something happens. +//! [`Component`]'s when something happens. #[macro_use] mod helpers; diff --git a/melib/src/email.rs b/melib/src/email.rs index 2fc53019..bcd0eeee 100644 --- a/melib/src/email.rs +++ b/melib/src/email.rs @@ -23,9 +23,9 @@ //! //! # Parsing bytes into an `Envelope` //! -//! An [`Envelope`](Envelope) represents the information you can get from an -//! email's headers and body structure. Addresses in `To`, `From` fields etc -//! are parsed into [`Address`](crate::email::Address) types. +//! An [`Envelope`] represents the information you can get from an email's +//! headers and body structure. Addresses in `To`, `From` fields etc are parsed +//! into [`Address`] types. //! //! ``` //! use melib::{Attachment, Envelope}; diff --git a/melib/src/email/parser.rs b/melib/src/email/parser.rs index 7875eb59..517a0c94 100644 --- a/melib/src/email/parser.rs +++ b/melib/src/email/parser.rs @@ -1606,8 +1606,7 @@ pub mod headers { )) } - /// Parse a single header as a ([`HeaderName`](crate::email::HeaderName), - /// [`&[u8]`]) tuple. + /// Parse a single header as a ([`HeaderName`], [`&[u8]`]) tuple. pub fn header_with_val(input: &[u8]) -> IResult<&[u8], (HeaderName, &[u8])> { if input.is_empty() { return Err(nom::Err::Error( diff --git a/melib/src/lib.rs b/melib/src/lib.rs index b9de309f..9ff8dde4 100644 --- a/melib/src/lib.rs +++ b/melib/src/lib.rs @@ -20,6 +20,7 @@ */ #![deny( + rustdoc::redundant_explicit_links, /* groups */ clippy::correctness, clippy::suspicious,