From afcf9fb2d01fa6434747f9cad82f7a0c3dc86602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 27 Dec 2022 16:31:58 +0100 Subject: [PATCH] parsers: correct cargo doc warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- parsers/ChangeLog | 1 + parsers/src/bind.rs | 4 ++-- parsers/src/bob.rs | 2 +- parsers/src/hashes.rs | 16 ++++++++-------- parsers/src/jingle.rs | 8 ++++---- parsers/src/jingle_grouping.rs | 2 +- parsers/src/jingle_rtp.rs | 2 +- parsers/src/media_element.rs | 2 +- parsers/src/muc/mod.rs | 4 ++-- parsers/src/muc/user.rs | 6 +++--- parsers/src/presence.rs | 3 ++- parsers/src/sasl.rs | 2 +- parsers/src/stanza_error.rs | 18 +++++++++--------- 13 files changed, 36 insertions(+), 34 deletions(-) diff --git a/parsers/ChangeLog b/parsers/ChangeLog index 618ed11c..57fc0068 100644 --- a/parsers/ChangeLog +++ b/parsers/ChangeLog @@ -2,6 +2,7 @@ Version xxx: xxx * Improvements: - muc::user::Item: Added with_ helpers + - Correct cargo doc warnings Version 0.19.2: 2022-12-17 Maxime “pep” Buquet diff --git a/parsers/src/bind.rs b/parsers/src/bind.rs index e6d4cf9b..127eb4f6 100644 --- a/parsers/src/bind.rs +++ b/parsers/src/bind.rs @@ -15,7 +15,7 @@ use std::str::FromStr; /// The request for resource binding, which is the process by which a client /// can obtain a full JID and start exchanging on the XMPP network. /// -/// See https://xmpp.org/rfcs/rfc6120.html#bind +/// See #[derive(Debug, Clone, PartialEq)] pub struct BindQuery { /// Requests this resource, the server may associate another one though. @@ -72,7 +72,7 @@ impl From for Element { /// The response for resource binding, containing the client’s full JID. /// -/// See https://xmpp.org/rfcs/rfc6120.html#bind +/// See #[derive(Debug, Clone, PartialEq)] pub struct BindResponse { /// The full JID returned by the server for this client. diff --git a/parsers/src/bob.rs b/parsers/src/bob.rs index 101a7490..dd18e25e 100644 --- a/parsers/src/bob.rs +++ b/parsers/src/bob.rs @@ -76,7 +76,7 @@ generate_element!( /// registered types, but unregistered or yet-to-be-registered are /// accepted too. /// - /// [1]: https://www.iana.org/assignments/media-types/media-types.xhtml + /// [1]: type_: Option = "type" ], text: ( diff --git a/parsers/src/hashes.rs b/parsers/src/hashes.rs index 704af523..d4a260ec 100644 --- a/parsers/src/hashes.rs +++ b/parsers/src/hashes.rs @@ -17,37 +17,37 @@ use std::str::FromStr; pub enum Algo { /// The Secure Hash Algorithm 1, with known vulnerabilities, do not use it. /// - /// See https://tools.ietf.org/html/rfc3174 + /// See Sha_1, /// The Secure Hash Algorithm 2, in its 256-bit version. /// - /// See https://tools.ietf.org/html/rfc6234 + /// See Sha_256, /// The Secure Hash Algorithm 2, in its 512-bit version. /// - /// See https://tools.ietf.org/html/rfc6234 + /// See Sha_512, /// The Secure Hash Algorithm 3, based on Keccak, in its 256-bit version. /// - /// See https://keccak.team/files/Keccak-submission-3.pdf + /// See Sha3_256, /// The Secure Hash Algorithm 3, based on Keccak, in its 512-bit version. /// - /// See https://keccak.team/files/Keccak-submission-3.pdf + /// See Sha3_512, /// The BLAKE2 hash algorithm, for a 256-bit output. /// - /// See https://tools.ietf.org/html/rfc7693 + /// See Blake2b_256, /// The BLAKE2 hash algorithm, for a 512-bit output. /// - /// See https://tools.ietf.org/html/rfc7693 + /// See Blake2b_512, /// An unknown hash not in this list, you can probably reject it. @@ -109,7 +109,7 @@ generate_element!( ); impl Hash { - /// Creates a [Hash] element with the given algo and data. + /// Creates a [struct@Hash] element with the given algo and data. pub fn new(algo: Algo, hash: Vec) -> Hash { Hash { algo, hash } } diff --git a/parsers/src/jingle.rs b/parsers/src/jingle.rs index 664d572e..6a9a2c80 100644 --- a/parsers/src/jingle.rs +++ b/parsers/src/jingle.rs @@ -103,7 +103,7 @@ generate_attribute!( /// defined in RFC 2183 and applied to SIP by RFC 3261. /// /// Possible values are defined here: - /// https://www.iana.org/assignments/cont-disp/cont-disp.xhtml + /// Disposition, "disposition", { /// Displayed automatically. Inline => "inline", @@ -131,14 +131,14 @@ generate_attribute!( RecipientListHistory => "recipient-list-history", /// The body describes a communications session, for example, an - /// RFC2327 SDP body. + /// [RFC2327](https://tools.ietf.org/html/rfc2327) SDP body. Session => "session", /// Authenticated Identity Body. Aib => "aib", /// The body describes an early communications session, for example, - /// and [RFC2327] SDP body. + /// and [RFC2327](https://tools.ietf.org/html/rfc2327) SDP body. EarlySession => "early-session", /// The body includes a list of URIs to which URI-list services are to @@ -347,7 +347,7 @@ impl Content { pub enum Reason { /// The party prefers to use an existing session with the peer rather than /// initiate a new session; the Jingle session ID of the alternative - /// session SHOULD be provided as the XML character data of the + /// session SHOULD be provided as the XML character data of the \ /// child. AlternativeSession, //(String), diff --git a/parsers/src/jingle_grouping.rs b/parsers/src/jingle_grouping.rs index 9b578964..cda993ca 100644 --- a/parsers/src/jingle_grouping.rs +++ b/parsers/src/jingle_grouping.rs @@ -27,7 +27,7 @@ generate_element!( ); impl Content { - /// Creates a new element. + /// Creates a new \ element. pub fn new(name: &str) -> Content { Content { name: ContentId(name.to_string()), diff --git a/parsers/src/jingle_rtp.rs b/parsers/src/jingle_rtp.rs index b2e670c5..d0566d74 100644 --- a/parsers/src/jingle_rtp.rs +++ b/parsers/src/jingle_rtp.rs @@ -141,7 +141,7 @@ generate_element!( Parameter, "parameter", JINGLE_RTP, attributes: [ /// The name of the parameter, from the list at - /// https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml + /// name: Required = "name", /// The value of this parameter. diff --git a/parsers/src/media_element.rs b/parsers/src/media_element.rs index 576bf9c1..536c0dd4 100644 --- a/parsers/src/media_element.rs +++ b/parsers/src/media_element.rs @@ -16,7 +16,7 @@ generate_element!( /// registered types, but unregistered or yet-to-be-registered are /// accepted too. /// - /// [1]: https://www.iana.org/assignments/media-types/media-types.xhtml + /// [1]: type_: Required = "type" ], text: ( diff --git a/parsers/src/muc/mod.rs b/parsers/src/muc/mod.rs index 5875e3ba..4d4ce413 100644 --- a/parsers/src/muc/mod.rs +++ b/parsers/src/muc/mod.rs @@ -4,10 +4,10 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -/// The http://jabber.org/protocol/muc protocol. +/// The `http://jabber.org/protocol/muc` protocol. pub mod muc; -/// The http://jabber.org/protocol/muc#user protocol. +/// The `http://jabber.org/protocol/muc#user` protocol. pub mod user; pub use self::muc::Muc; diff --git a/parsers/src/muc/user.rs b/parsers/src/muc/user.rs index 3c7390da..b5599235 100644 --- a/parsers/src/muc/user.rs +++ b/parsers/src/muc/user.rs @@ -78,7 +78,7 @@ Status, "status", MUC_USER, "code", { ServiceErrorKick => 333, }); -/// Optional element used in elements inside presence stanzas of type +/// Optional \ element used in \ elements inside presence stanzas of type /// "unavailable" that are sent to users who are kick or banned, as well as within IQs for tracking /// purposes. -- CHANGELOG 0.17 (2002-10-23) /// @@ -227,8 +227,8 @@ impl Item { } /// Set a jid for this Item - pub fn with_jid>(mut self, jid: J) -> Item { - self.jid = Some(jid.into()); + pub fn with_jid(mut self, jid: FullJid) -> Item { + self.jid = Some(jid); self } diff --git a/parsers/src/presence.rs b/parsers/src/presence.rs index 6ea5a847..fcd81b96 100644 --- a/parsers/src/presence.rs +++ b/parsers/src/presence.rs @@ -75,7 +75,8 @@ pub enum Type { /// An error has occurred regarding processing of a previously sent /// presence stanza; if the presence stanza is of type "error", it MUST - /// include an child element (refer to [XMPP‑CORE]). + /// include an \ child element (refer to + /// [XMPP‑CORE](https://xmpp.org/rfcs/rfc6120.html)). Error, /// A request for an entity's current presence; SHOULD be generated only by diff --git a/parsers/src/sasl.rs b/parsers/src/sasl.rs index a486c136..9f2ca9c2 100644 --- a/parsers/src/sasl.rs +++ b/parsers/src/sasl.rs @@ -22,7 +22,7 @@ generate_attribute!( /// client and the server to avoid having to store the password in /// clear. /// - /// See https://tools.ietf.org/html/rfc5802 + /// See ScramSha1 => "SCRAM-SHA-1", /// Same as [ScramSha1](#structfield.ScramSha1), with the addition of diff --git a/parsers/src/stanza_error.rs b/parsers/src/stanza_error.rs index 9a2604eb..3afd678b 100644 --- a/parsers/src/stanza_error.rs +++ b/parsers/src/stanza_error.rs @@ -64,14 +64,14 @@ generate_element_enum!( Forbidden => "forbidden", /// The recipient or server can no longer be contacted at this address, - /// typically on a permanent basis (as opposed to the error + /// typically on a permanent basis (as opposed to the \ error /// condition, which is used for temporary addressing failures); the /// associated error type SHOULD be "cancel" and the error stanza /// SHOULD include a new address (if available) as the XML character - /// data of the element (which MUST be a Uniform Resource - /// Identifier [URI] or Internationalized Resource Identifier [IRI] at + /// data of the \ element (which MUST be a Uniform Resource + /// Identifier (URI) or Internationalized Resource Identifier (IRI) at /// which the entity can be contacted, typically an XMPP IRI as - /// specified in [XMPP‑URI]). + /// specified in [XMPP‑URI](https://tools.ietf.org/html/rfc5122)). Gone => "gone", /// The server has experienced a misconfiguration or other internal @@ -105,7 +105,7 @@ generate_element_enum!( /// The sender needs to provide credentials before being allowed to /// perform the action, or has provided improper credentials (the name /// "not-authorized", which was borrowed from the "401 Unauthorized" - /// error of [HTTP], might lead the reader to think that this condition + /// error of HTTP, might lead the reader to think that this condition /// relates to authorization, but instead it is typically used in /// relation to authentication); the associated error type SHOULD be /// "auth". @@ -113,7 +113,7 @@ generate_element_enum!( /// The entity has violated some local service policy (e.g., a message /// contains words that are prohibited by the service) and the server - /// MAY choose to specify the policy in the element or in an + /// MAY choose to specify the policy in the \ element or in an /// application-specific condition element; the associated error type /// SHOULD be "modify" or "wait" depending on the policy being /// violated. @@ -125,12 +125,12 @@ generate_element_enum!( /// The recipient or server is redirecting requests for this /// information to another entity, typically in a temporary fashion (as - /// opposed to the error condition, which is used for permanent + /// opposed to the \ error condition, which is used for permanent /// addressing failures); the associated error type SHOULD be "modify" /// and the error stanza SHOULD contain the alternate address in the - /// XML character data of the element (which MUST be a URI + /// XML character data of the \ element (which MUST be a URI /// or IRI with which the sender can communicate, typically an XMPP IRI - /// as specified in [XMPP‑URI]). + /// as specified in [XMPP‑URI](https://xmpp.org/rfcs/rfc5122.html)). Redirect => "redirect", /// The requesting entity is not authorized to access the requested