diff --git a/meli/src/args.rs b/meli/src/args.rs index c151d234..b60f1120 100644 --- a/meli/src/args.rs +++ b/meli/src/args.rs @@ -50,8 +50,8 @@ pub enum SubCommand { /// edit configuration files with `$EDITOR`/`$VISUAL`. EditConfig, /// create a sample configuration file with available configuration options. - /// If PATH is not specified, meli will try to create it in - /// $XDG_CONFIG_HOME/meli/config.toml + /// If `PATH` is not specified, meli will try to create it in + /// `$XDG_CONFIG_HOME/meli/config.toml` #[structopt(display_order = 1)] CreateConfig { #[structopt(value_name = "NEW_CONFIG_PATH", parse(from_os_str))] @@ -69,8 +69,8 @@ pub enum SubCommand { Man(ManOpt), #[structopt(display_order = 4)] - /// Install manual pages to the first location provided by $MANPATH / - /// manpath(1), unless you specify the directory as an argument. + /// Install manual pages to the first location provided by `$MANPATH` / + /// `manpath(1)`, unless you specify the directory as an argument. InstallMan { #[structopt(value_name = "DESTINATION_PATH", parse(from_os_str))] destination_path: Option, @@ -93,7 +93,7 @@ pub struct ManOpt { #[cfg_attr(feature = "cli-docs", structopt(default_value = "meli", possible_values=manpages::POSSIBLE_VALUES, value_name="PAGE", parse(try_from_str = manpages::parse_manpage)))] /// Name of manual page. pub page: manpages::ManPages, - /// If true, output text in stdout instead of spawning $PAGER. + /// If true, output text in stdout instead of spawning `$PAGER`. #[cfg(feature = "cli-docs")] #[cfg_attr( feature = "cli-docs", diff --git a/meli/src/terminal/keys.rs b/meli/src/terminal/keys.rs index 5573bf80..e6ede513 100644 --- a/meli/src/terminal/keys.rs +++ b/meli/src/terminal/keys.rs @@ -120,11 +120,11 @@ pub enum MouseButton { Middle, /// Mouse wheel is going up. /// - /// This event is typically only used with Mouse::Press. + /// This event is typically only used with [`MouseEvent::Press`]. WheelUp, /// Mouse wheel is going down. /// - /// This event is typically only used with Mouse::Press. + /// This event is typically only used with [`MouseEvent::Press`]. WheelDown, } diff --git a/melib/src/backends.rs b/melib/src/backends.rs index 6acc6322..750dd12b 100644 --- a/melib/src/backends.rs +++ b/melib/src/backends.rs @@ -273,7 +273,7 @@ impl From for BackendEvent { #[derive(Clone, Debug)] pub enum RefreshEventKind { Update(EnvelopeHash, Box), - /// Rename(old_hash, new_hash) + /// `Rename(old_hash, new_hash)` Rename(EnvelopeHash, EnvelopeHash), Create(Box), Remove(EnvelopeHash), diff --git a/melib/src/error.rs b/melib/src/error.rs index 12fe3f11..bcd0d1f6 100644 --- a/melib/src/error.rs +++ b/melib/src/error.rs @@ -55,7 +55,7 @@ pub enum NetworkErrorKind { RequestBodyNotRewindable, /// Connection (not request) timeout. Timeout, - /// TooManyRedirects + /// Too many redirects TooManyRedirects, /// Invalid TLS connection InvalidTLSConnection, diff --git a/melib/src/jmap/connection.rs b/melib/src/jmap/connection.rs index c45ad0e4..0b811676 100644 --- a/melib/src/jmap/connection.rs +++ b/melib/src/jmap/connection.rs @@ -237,7 +237,7 @@ impl JmapConnection { .set(Some(req_instant), Ok(session)) .await; - /* Fetch account identities. */ + // Fetch account identities. let mut id_list = { let mut req = Request::new(self.request_no.clone()); diff --git a/melib/src/jmap/objects/email/import.rs b/melib/src/jmap/objects/email/import.rs index a58f9e1e..d2fab734 100644 --- a/melib/src/jmap/objects/email/import.rs +++ b/melib/src/jmap/objects/email/import.rs @@ -48,7 +48,7 @@ pub struct EmailImport { #[serde(skip_serializing_if = "Option::is_none")] pub if_in_state: Option>, /// o emails: `Id[EmailImport]` - /// A map of creation id (client specified) to EmailImport objects. + /// A map of creation id (client specified) to [`EmailImport`] objects. pub emails: IndexMap, EmailImportObject>, } @@ -131,11 +131,11 @@ pub enum EmailImportError { /// `RFC5322`, or even just with the same Message-ID `RFC5322`, to /// coexist within an account. In this case, it MUST reject attempts to /// import an Email considered to be a duplicate with an `alreadyExists` - /// SetError. + /// [`SetError`]. AlreadyExists { description: Option, /// An `existingId` property of type `Id` MUST be included on - /// the SetError object with the id of the existing Email. If + /// the [`SetError`] object with the id of the existing Email. If /// duplicates are allowed, the newly created Email object MUST /// have a separate id and independent mutable properties to the /// existing object. @@ -143,21 +143,21 @@ pub enum EmailImportError { }, /// If the `blobId`, `mailboxIds`, or `keywords` properties are invalid /// (e.g., missing, wrong type, id not found), the server MUST reject the - /// import with an `invalidProperties` SetError. + /// import with an `invalidProperties` [`SetError`]. InvalidProperties { description: Option, properties: Vec, }, /// If the Email cannot be imported because it would take the account /// over quota, the import should be rejected with an `overQuota` - /// SetError. + /// [`SetError`]. OverQuota { description: Option }, /// If the blob referenced is not a valid message `RFC5322`, the server /// MAY modify the message to fix errors (such as removing NUL octets or /// fixing invalid headers). If it does this, the `blobId` on the /// response MUST represent the new representation and therefore be - /// different to the `blobId` on the EmailImport object. Alternatively, - /// the server MAY reject the import with an `invalidEmail` SetError. + /// different to the `blobId` on the [`EmailImport`] object. Alternatively, + /// the server MAY reject the import with an `invalidEmail` [`SetError`]. InvalidEmail { description: Option }, /// An `ifInState` argument was supplied, and it does not match the current /// state. @@ -189,7 +189,7 @@ pub struct EmailImportResponse { pub created: Option, EmailImportResult>>, /// o notCreated: `Id[SetError]|null` - /// A map of the creation id to a SetError object for each Email that + /// A map of the creation id to a [`SetError`] object for each Email that /// failed to be created, or null if all successful. The possible /// errors are defined above. pub not_created: Option, EmailImportError>>, diff --git a/melib/src/jmap/objects/identity.rs b/melib/src/jmap/objects/identity.rs index 60ca953d..8c5737d1 100644 --- a/melib/src/jmap/objects/identity.rs +++ b/melib/src/jmap/objects/identity.rs @@ -33,52 +33,52 @@ pub struct IdentityObject { pub id: Id, /// name: `String` (default: "") - /// The "From" name the client SHOULD use when creating a new Email - /// from this Identity. + /// The "From" name the client SHOULD use when creating a new + /// [`Email`](EmailObject) from this Identity. #[serde(default)] pub name: String, /// email: `String` (immutable) /// The "From" email address the client MUST use when creating a new - /// Email from this Identity. If the "mailbox" part of the address - /// (the section before the "@") is the single character "*" (e.g., - /// "*@example.com"), the client may use any valid address ending in - /// that domain (e.g., "[email protected]"). + /// [`Email`](EmailObject) from this Identity. If the "mailbox" part of the + /// address (the section before the "@") is the single character "*" + /// (e.g., "*@example.com"), the client may use any valid address ending + /// in that domain (e.g., "[email protected]"). pub email: String, /// replyTo: `EmailAddress[]|null` (default: null) - /// The Reply-To value the client SHOULD set when creating a new Email - /// from this Identity. + /// The Reply-To value the client SHOULD set when creating a new + /// [`Email`](EmailObject) from this Identity. #[serde(default)] pub reply_to: Option>, /// bcc: `EmailAddress[]|null` (default: null) - /// The Bcc value the client SHOULD set when creating a new Email from - /// this Identity. + /// The Bcc value the client SHOULD set when creating a new + /// [`Email`](EmailObject) from this Identity. #[serde(default)] pub bcc: Option>, /// textSignature: `String` (default: "") /// A signature the client SHOULD insert into new plaintext messages - // that will be sent from this Identity. Clients MAY ignore this - // and/or combine this with a client-specific signature preference. + /// that will be sent from this Identity. Clients MAY ignore this + /// and/or combine this with a client-specific signature preference. #[serde(default)] pub text_signature: String, /// htmlSignature: `String` (default: "") /// A signature the client SHOULD insert into new HTML messages that - /// will be sent from this Identity. This text MUST be an HTML - /// snippet to be inserted into the "" section of the - /// HTML. Clients MAY ignore this and/or combine this with a client- + /// will be sent from this Identity. This text MUST be an HTML + /// snippet to be inserted into the `` section of the + /// HTML. Clients MAY ignore this and/or combine this with a client- /// specific signature preference. #[serde(default)] pub html_signature: String, /// mayDelete: `Boolean` (server-set) - /// Is the user allowed to delete this Identity? Servers may wish to - /// set this to false for the user's username or other default - /// address. Attempts to destroy an Identity with "mayDelete: false" - /// will be rejected with a standard "forbidden" SetError. + /// Is the user allowed to delete this Identity? Servers may wish to + /// set this to `false` for the user's username or other default + /// address. Attempts to destroy an Identity with "mayDelete: false" + /// will be rejected with a standard "forbidden" [`SetError`]. #[serde(skip_serializing)] pub may_delete: bool, } @@ -102,7 +102,7 @@ impl Method for IdentityChanges { /// /// ```text /// This is a standard "/set" method as described in [RFC8620], -/// Section 5.3. The following extra SetError types are defined: +/// Section 5.3. The following extra [`SetError`] types are defined: /// For "create": /// o "forbiddenFrom": The user is not allowed to send from the address /// given as the "email" property of the Identity. diff --git a/melib/src/jmap/objects/mailbox.rs b/melib/src/jmap/objects/mailbox.rs index 08885286..5567f327 100644 --- a/melib/src/jmap/objects/mailbox.rs +++ b/melib/src/jmap/objects/mailbox.rs @@ -103,11 +103,13 @@ impl Method for MailboxGet { /// /// For `destroy`: /// -/// - `mailboxHasChild`: The Mailbox still has at least one child Mailbox. The -/// client MUST remove these before it can delete the parent Mailbox. +/// - `mailboxHasChild`: The [`Mailbox`](MailboxObject) still has at least one +/// child [`Mailbox`](MailboxObject). The client MUST remove these before it +/// can delete the parent [`Mailbox`](MailboxObject). /// -/// - `mailboxHasEmail`: The Mailbox has at least one Email assigned to it, and -/// the `onDestroyRemoveEmails` argument was false. +/// - `mailboxHasEmail`: The [`Mailbox`](MailboxObject) has at least one +/// [`Email`](EmailObject) assigned to it, and the `onDestroyRemoveEmails` +/// argument was false. #[derive(Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct MailboxSet { @@ -115,11 +117,13 @@ pub struct MailboxSet { pub set_call: Set, /// onDestroyRemoveEmails: `Boolean` (default: false) /// - /// If false, any attempt to destroy a Mailbox that still has Emails - /// in it will be rejected with a `mailboxHasEmail` SetError. If - /// true, any Emails that were in the Mailbox will be removed from it, - /// and if in no other Mailboxes, they will be destroyed when the - /// Mailbox is destroyed. + /// If false, any attempt to destroy a [`Mailbox`](MailboxObject) that still + /// has [`Email`s](EmailObject) in it will be rejected with a + /// `mailboxHasEmail` [`SetError`]. If + /// true, any [`Email`s](EmailObject) that were in the + /// [`Mailbox`](MailboxObject) will be removed from it, and if in no + /// other [`Mailbox`es](MailboxObject), they will be destroyed when the + /// [`Mailbox`](MailboxObject) is destroyed. #[serde(default)] pub on_destroy_remove_emails: bool, } diff --git a/melib/src/jmap/objects/submission.rs b/melib/src/jmap/objects/submission.rs index 9a6e3e4e..394f1041 100644 --- a/melib/src/jmap/objects/submission.rs +++ b/melib/src/jmap/objects/submission.rs @@ -293,9 +293,9 @@ pub struct EmailSubmissionSet { /// A map of [`EmailSubmissionObject`] id to an object containing properties /// to update on the [`Email`](EmailObject) object referenced by the /// [`EmailSubmissionObject`] if the create/update/destroy succeeds. (For - /// references to EmailSubmissions created in the same - /// `/set` invocation, this is equivalent to a creation-reference, so the id - /// will be the creation id prefixed with a `#`.) + /// references to [`EmailSubmissions`](EmailSubmissionObject) created in the + /// same `/set` invocation, this is equivalent to a creation-reference, + /// so the id will be the creation id prefixed with a `#`.) #[serde(default)] pub on_success_update_email: Option, PatchObject>>, /// onSuccessDestroyEmail: `Id[]|null` diff --git a/melib/src/jmap/rfc8620.rs b/melib/src/jmap/rfc8620.rs index c3d963a0..0cab4d99 100644 --- a/melib/src/jmap/rfc8620.rs +++ b/melib/src/jmap/rfc8620.rs @@ -726,7 +726,7 @@ where /// A map of an id to a Patch object to apply to the current Foo /// object with that id, or null if no objects are to be updated. /// - /// A *PatchObject* is of type `String[*]` and represents an unordered + /// A [`PatchObject`] is of type `String[*]` and represents an unordered /// set of patches. The keys are a path in JSON Pointer format /// `RFC6901`, with an implicit leading `/` (i.e., prefix each key /// with `/` before applying the JSON Pointer evaluation algorithm). @@ -741,8 +741,8 @@ where /// * All parts prior to the last (i.e., the value after the final slash) /// MUST already exist on the object being patched. /// - /// * There MUST NOT be two patches in the PatchObject where the pointer - /// of one is the prefix of the pointer of the other, e.g., + /// * There MUST NOT be two patches in the [`PatchObject`] where the + /// pointer of one is the prefix of the pointer of the other, e.g., /// `alerts/1/offset` and `alerts`. /// /// The value associated with each pointer determines how to apply @@ -758,10 +758,10 @@ where /// Any server-set properties MAY be included in the patch if their /// value is identical to the current server value (before applying /// the patches to the object). Otherwise, the update MUST be - /// rejected with an `invalidProperties` SetError. + /// rejected with an `invalidProperties` [`SetError`]. /// /// This patch definition is designed such that an entire Foo object - /// is also a valid PatchObject. The client may choose to optimise + /// is also a valid [`PatchObject`]. The client may choose to optimise /// network usage by just sending the diff or may send the whole /// object; the server processes it the same either way. pub update: Option>, PatchObject>>, @@ -876,7 +876,7 @@ pub struct SetResponse { /// successfully updated. /// /// The value for each id is a Foo object containing any property that - /// changed in a way *not* explicitly requested by the PatchObject + /// changed in a way *not* explicitly requested by the [`PatchObject`] /// sent to the server, or null if none. This lets the client know of /// any changes to server-set or computed properties. /// @@ -889,17 +889,17 @@ pub struct SetResponse { pub destroyed: Option>>, /// o notCreated: `Id[SetError]|null` /// - /// A map of the creation id to a SetError object for each record that + /// A map of the creation id to a [`SetError`] object for each record that /// failed to be created, or null if all successful. pub not_created: Option>, /// o notUpdated: `Id[SetError]|null` /// - /// A map of the Foo id to a SetError object for each record that + /// A map of the Foo id to a [`SetError`] object for each record that /// failed to be updated, or null if all successful. pub not_updated: Option>, /// o notDestroyed: `Id[SetError]|null` /// - /// A map of the Foo id to a SetError object for each record that + /// A map of the Foo id to a [`SetError`] object for each record that /// failed to be destroyed, or null if all successful.// pub not_destroyed: Option>, } @@ -938,8 +938,8 @@ pub enum SetError { /// (update; destroy). The id given to update/destroy cannot be found. NotFound(Option), - /// (update). The PatchObject given to update the record was not a valid - /// patch (see the patch description). + /// (update). The [`PatchObject`] given to update the record was not a + /// valid patch (see the patch description). InvalidPatch(Option), /// (update). The client requested that an object be both updated and @@ -1254,7 +1254,7 @@ pub struct QueryChangesResponse { /// The array MUST be sorted in order of index, with the lowest index /// first. - /// An *AddedItem* object has the following properties: + /// An [`AddedItem`] object has the following properties: /// * id: `Id`