Fix some rustdoc lints

pull/223/head
Manos Pitsidianakis 2023-06-04 21:07:26 +03:00
parent bf615e7d93
commit 27a4dcb916
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
8 changed files with 83 additions and 69 deletions

View File

@ -344,15 +344,15 @@ pub mod dates {
}
}
///In the obsolete time zone, "UT" and "GMT" are indications of
///"Universal Time" and "Greenwich Mean Time", respectively, and are
///both semantically identical to "+0000".
/// In the obsolete time zone, "UT" and "GMT" are indications of
/// "Universal Time" and "Greenwich Mean Time", respectively, and are
/// both semantically identical to "+0000".
///The remaining three character zones are the US time zones. The first
///letter, "E", "C", "M", or "P" stands for "Eastern", "Central",
///"Mountain", and "Pacific". The second letter is either "S" for
///"Standard" time, or "D" for "Daylight Savings" (or summer) time.
///Their interpretations are as follows:
/// The remaining three character zones are the US time zones. The first
/// letter, "E", "C", "M", or "P" stands for "Eastern", "Central",
/// "Mountain", and "Pacific". The second letter is either "S" for
/// "Standard" time, or "D" for "Daylight Savings" (or summer) time.
/// Their interpretations are as follows:
/// EDT is semantically equivalent to -0400
/// EST is semantically equivalent to -0500
@ -363,21 +363,21 @@ pub mod dates {
/// PDT is semantically equivalent to -0700
/// PST is semantically equivalent to -0800
///The 1 character military time zones were defined in a non-standard
///way in [RFC0822] and are therefore unpredictable in their meaning.
///The original definitions of the military zones "A" through "I" are
///equivalent to "+0100" through "+0900", respectively; "K", "L", and
///"M" are equivalent to "+1000", "+1100", and "+1200", respectively;
///"N" through "Y" are equivalent to "-0100" through "-1200".
///respectively; and "Z" is equivalent to "+0000". However, because of
///the error in [RFC0822], they SHOULD all be considered equivalent to
///"-0000" unless there is out-of-band information confirming their
///meaning.
/// The 1 character military time zones were defined in a non-standard
/// way in RFC0822 and are therefore unpredictable in their meaning.
/// The original definitions of the military zones "A" through "I" are
/// equivalent to "+0100" through "+0900", respectively; "K", "L", and
/// "M" are equivalent to "+1000", "+1100", and "+1200", respectively;
/// "N" through "Y" are equivalent to "-0100" through "-1200".
/// respectively; and "Z" is equivalent to "+0000". However, because of
/// the error in RFC0822, they SHOULD all be considered equivalent to
/// "-0000" unless there is out-of-band information confirming their
/// meaning.
///Other multi-character (usually between 3 and 5) alphabetic time zones
///have been used in Internet messages. Any such time zone whose
///meaning is not known SHOULD be considered equivalent to "-0000"
///unless there is out-of-band information confirming their meaning.
/// Other multi-character (usually between 3 and 5) alphabetic time zones
/// have been used in Internet messages. Any such time zone whose
/// meaning is not known SHOULD be considered equivalent to "-0000"
/// unless there is out-of-band information confirming their meaning.
fn obs_zone(input: &[u8]) -> IResult<&[u8], (&[u8], &[u8])> {
alt((
map(tag("UT"), |_| (&b"+"[..], &b"0000"[..])),
@ -394,7 +394,9 @@ pub mod dates {
))(input)
}
///zone = (FWS ( "+" / "-" ) 4DIGIT) / obs-zone
/// ```text
/// zone = (FWS ( "+" / "-" ) 4DIGIT) / obs-zone
/// ```
fn zone(input: &[u8]) -> IResult<&[u8], (&[u8], &[u8])> {
alt((
|input| {
@ -406,13 +408,15 @@ pub mod dates {
))(input)
}
///date-time = [ day-of-week "," ] date time [CFWS]
///date = day month year
///time = time-of-day zone
///time-of-day = hour ":" minute [ ":" second ]
///hour = 2DIGIT / obs-hour
///minute = 2DIGIT / obs-minute
///second = 2DIGIT / obs-second
/// ```text
/// date-time = [ day-of-week "," ] date time [CFWS]
/// date = day month year
/// time = time-of-day zone
/// time-of-day = hour ":" minute [ ":" second ]
/// hour = 2DIGIT / obs-hour
/// minute = 2DIGIT / obs-minute
/// second = 2DIGIT / obs-second
/// ```
fn date_time(input: &[u8]) -> IResult<&[u8], UnixTimestamp> {
let orig_input = input;
let mut accum: SmallVec<[u8; 32]> = SmallVec::new();
@ -459,8 +463,9 @@ pub mod dates {
}
}
///e.g Wed Sep 9 00:27:54 2020
///```text
/// e.g Wed Sep 9 00:27:54 2020
///
/// ```text
/// day-of-week month day time year
/// date-time = [ day-of-week "," ] date time [CFWS]
/// date = day month year
@ -520,9 +525,11 @@ pub mod dates {
}
}
///`day-of-week = ([FWS] day-name) / obs-day-of-week`
///day-name = "Mon" / "Tue" / "Wed" / "Thu" /
/// ```text
/// day-of-week = ([FWS] day-name) / obs-day-of-week
/// day-name = "Mon" / "Tue" / "Wed" / "Thu" /
/// "Fri" / "Sat" / "Sun"
/// ```
fn day_of_week(input: &[u8]) -> IResult<&[u8], Cow<'_, [u8]>> {
let (input, day_name) = alt((
tag("Mon"),
@ -536,7 +543,7 @@ pub mod dates {
Ok((input, day_name.into()))
}
///day = ([FWS] 1*2DIGIT FWS) / obs-day
/// `day = ([FWS] 1*2DIGIT FWS) / obs-day`
fn day(input: &[u8]) -> IResult<&[u8], &[u8]> {
let (input, _) = opt(fws)(input)?;
let (input, ret) = alt((take_n_digits(2), take_n_digits(1)))(input)?;
@ -545,9 +552,11 @@ pub mod dates {
Ok((input, ret))
}
///month = "Jan" / "Feb" / "Mar" / "Apr" /
/// ```text
/// month = "Jan" / "Feb" / "Mar" / "Apr" /
/// "May" / "Jun" / "Jul" / "Aug" /
/// "Sep" / "Oct" / "Nov" / "Dec"
/// ```
fn month(input: &[u8]) -> IResult<&[u8], &[u8]> {
alt((
tag("Jan"),

View File

@ -202,7 +202,7 @@ pub struct SmtpExtensionSupport {
#[serde(default = "crate::conf::true_val")]
binarymime: bool,
/// Resources:
/// - http://www.postfix.org/SMTPUTF8_README.html
/// - <http://www.postfix.org/SMTPUTF8_README.html>
#[serde(default = "crate::conf::true_val")]
smtputf8: bool,
#[serde(default = "crate::conf::true_val")]
@ -608,7 +608,7 @@ impl SmtpConnection {
}
let mut current_command: SmallVec<[&[u8]; 16]> = SmallVec::new();
//first step in the procedure is the MAIL command.
// MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF>
// `MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF>`
current_command.push(b"MAIL FROM:<");
if !envelope_from.is_empty() {
current_command.push(envelope_from.trim().as_bytes());
@ -668,8 +668,8 @@ impl SmtpConnection {
}
self.send_command(&current_command).await?;
//RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>
//If accepted, the SMTP server returns a "250 OK" reply and stores the
//`RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>`
// If accepted, the SMTP server returns a "250 OK" reply and stores the
// forward-path.
if !self.server_conf.extensions.pipelining {
self.read_lines(&mut res, Some((ReplyCode::_250, &[])))
@ -679,7 +679,7 @@ impl SmtpConnection {
}
}
//Since it has been a common source of errors, it is worth noting that spaces
// Since it has been a common source of errors, it is worth noting that spaces
// are not permitted on either side of the colon following FROM in the
// MAIL command or TO in the RCPT command. The syntax is exactly as
// given above.
@ -692,7 +692,7 @@ impl SmtpConnection {
} else {
//The third step in the procedure is the DATA command
//(or some alternative specified in a service extension).
//DATA <CRLF>
//DATA `<CRLF>`
self.send_command(&[b"DATA"]).await?;
//Client SMTP implementations that employ pipelining MUST check ALL statuses
// associated with each command in a group. For example, if none of
@ -739,7 +739,7 @@ impl SmtpConnection {
}
//The mail data are terminated by a line containing only a period, that is, the
// character sequence "<CRLF>.<CRLF>", where the first <CRLF> is
// character sequence "`<CRLF>`.`<CRLF>`", where the first `<CRLF>` is
// actually the terminator of the previous line (see Section 4.5.2).
// This is the end of mail data indication.
self.stream.write_all(b".\r\n").await?;
@ -788,15 +788,15 @@ pub enum ReplyCode {
/// particular non-standard command; this reply is useful only to the human
/// user)
_214,
/// <domain> Service ready
/// `<domain>` Service ready
_220,
/// <domain> Service closing transmission channel
/// `<domain>` Service closing transmission channel
_221,
/// Authentication successful,
_235,
/// Requested mail action okay, completed
_250,
/// User not local; will forward to <forward-path> (See Section 3.4)
/// User not local; will forward to `<forward-path>` (See Section 3.4)
_251,
/// Cannot VRFY user, but will accept message and attempt delivery (See
/// Section 3.5.3)
@ -805,9 +805,9 @@ pub enum ReplyCode {
_334,
/// PRDR specific, eg "content analysis has started|
_353,
/// Start mail input; end with <CRLF>.<CRLF>
/// Start mail input; end with `<CRLF>`.`<CRLF>`
_354,
/// <domain> Service not available, closing transmission channel (This may
/// `<domain>` Service not available, closing transmission channel (This may
/// be a reply to any command if the service knows it must shut down)
_421,
/// Requested mail action not taken: mailbox unavailable (e.g., mailbox busy
@ -835,7 +835,7 @@ pub enum ReplyCode {
/// Requested action not taken: mailbox unavailable (e.g., mailbox not
/// found, no access, or command rejected for policy reasons)
_550,
/// User not local; please try <forward-path> (See Section 3.4)
/// User not local; please try `<forward-path>` (See Section 3.4)
_551,
/// Requested mail action aborted: exceeded storage allocation
_552,
@ -998,8 +998,8 @@ async fn read_lines<'r>(
let mut returned_code: Option<ReplyCode> = None;
'read_loop: loop {
while let Some(pos) = ret[last_line_idx..].find("\r\n") {
// "Formally, a reply is defined to be the sequence: a three-digit code, <SP>,
// one line of text, and <CRLF>, or a multiline reply (as defined in the same
// "Formally, a reply is defined to be the sequence: a three-digit code, `<SP>`,
// one line of text, and `<CRLF>`, or a multiline reply (as defined in the same
// section)."
if ret[last_line_idx..].len() < 4
|| !ret[last_line_idx..]

View File

@ -49,9 +49,9 @@ use crate::error::{Result, ResultIntoError};
pub type UnixTimestamp = u64;
pub mod formats {
/// <date>T<time>
/// `<date>`T`<time>`
pub const RFC3339_DATETIME: &str = "%Y-%m-%dT%H:%M:%S\0";
/// <date>T<time>
/// `<date>`T`<time>`
pub const RFC3339_DATETIME_AND_SPACE: &str = "%Y-%m-%d %H:%M:%S\0";
pub const RFC3339_DATE: &str = "%Y-%m-%d\0";

View File

@ -33,11 +33,11 @@ pub mod listing;
pub use crate::listing::*;
pub mod view;
pub use crate::view::*;
mod compose;
pub mod compose;
pub use self::compose::*;
#[cfg(feature = "gpgme")]
pub mod pgp;
mod status;
pub mod status;
pub use self::status::*;

View File

@ -71,7 +71,7 @@ impl std::ops::DerefMut for HookFn {
pub struct Hook {
/// Hook name for enabling/disabling it from configuration.
///
/// See [`ComposingSettings::disabled_compose_hooks`].
/// See [`crate::conf::ComposingSettings::disabled_compose_hooks`].
name: Cow<'static, str>,
hook_fn: HookFn,
}
@ -79,7 +79,7 @@ pub struct Hook {
impl Hook {
/// Hook name for enabling/disabling it from configuration.
///
/// See [`ComposingSettings::disabled_compose_hooks`].
/// See [`crate::conf::ComposingSettings::disabled_compose_hooks`].
pub fn name(&self) -> &str {
self.name.as_ref()
}

View File

@ -185,7 +185,8 @@ pub enum SendMail {
ShellCommand(String),
}
/// Shell command compose hooks (See [`Hook`])
/// Shell command compose hooks (See
/// [`crate::components::mail::compose::hooks::Hook`])
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct ComposeHook {

View File

@ -19,20 +19,24 @@
* along with meli. If not, see <http://www.gnu.org/licenses/>.
*/
/*! The application's state.
The UI crate has an Box<dyn Component>-Component-System design. The System part, is also the application's state, so they're both merged in the `State` struct.
`State` owns all the Components of the UI. In the application's main event loop, input is handed to the state in the form of `UIEvent` objects which traverse the component graph. Components decide to handle each input or not.
Input is received in the main loop from threads which listen on the stdin for user input, observe folders for file changes etc. The relevant struct is `ThreadEvent`.
*/
//! The application's state.
//!
//! The UI crate has an `Box<dyn Component>`-Component-System design. The system
//! part, is also the application's state, so they're both merged in the
//! [`State`] struct.
//!
//! [`State`] owns all the Components of the UI. In the application's main event
//! loop, input is handed to the state in the form of [`UIEvent`] objects which
//! traverse the component graph. Components decide to handle each input or not.
//!
//! Input is received in the main loop from threads which listen on the stdin
//! for user input, observe folders for file changes etc. The relevant struct is
//! [`ThreadEvent`].
use std::{env, os::unix::io::RawFd, sync::Arc, thread};
use crossbeam::channel::{unbounded, Receiver, Sender};
use indexmap::IndexMap;
//use crate::plugins::PluginManager;
use melib::{
backends::{AccountHash, BackendEvent, BackendEventConsumer, Backends, RefreshEvent},
UnixTimestamp,

View File

@ -167,8 +167,8 @@ use termion::input::TermReadEventsAndRaw;
/// fork, and then the thread kills itself. The parent process spawns a new
/// input-thread when the child returns.
///
/// The main loop uses [`State::try_wait_on_child`] to check if child has
/// exited.
/// The main loop uses [`crate::state::State::try_wait_on_child`] to check if
/// child has exited.
pub fn get_events(
mut closure: impl FnMut((Key, Vec<u8>)),
rx: &Receiver<InputCommand>,