From 3d98f4ce7f1c8d824aa411bd5c08e2734bd98b91 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 9 Feb 2024 23:28:27 +0000 Subject: [PATCH] Add testing of doc links in test.sh --- src/lib.rs | 2 ++ src/rr.rs | 16 ++++++++++------ src/validation.rs | 6 +++--- test.sh | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0cabe01..b36f054 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,6 +26,8 @@ //! proofs. #![deny(missing_docs)] +#![deny(rustdoc::broken_intra_doc_links)] +#![deny(rustdoc::private_intra_doc_links)] #![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; diff --git a/src/rr.rs b/src/rr.rs index d3a6dd4..9886e3a 100644 --- a/src/rr.rs +++ b/src/rr.rs @@ -300,7 +300,7 @@ pub struct CName { pub name: Name, /// The canonical name. /// - /// A resolver should use this name when looking up any further records for [`Self::name`]. + /// A resolver should use this name when looking up any further records for [`self.name`]. pub canonical_name: Name, } impl StaticRecord for CName { @@ -385,7 +385,7 @@ impl DnsKey { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] /// A Delegation Signer resource record which indicates that some alternative [`DnsKey`] can sign -/// for records in the zone which matches [`DS::name`]. +/// for records in the zone which matches [`self.name`]. pub struct DS { /// The name this record is at. /// @@ -447,7 +447,7 @@ pub struct RRSig { pub name: Name, /// The resource record type which this [`RRSig`] is signing. /// - /// All resources records of this type at the same name as [`Self::name`] must be signed by + /// All resources records of this type at the same name as [`self.name`] must be signed by /// this [`RRSig`]. pub ty: u16, /// The algorithm which is being used to sign. @@ -456,7 +456,7 @@ pub struct RRSig { pub alg: u8, /// The number of labels in the name of the records that this signature is signing. /// - /// If this is less than the number of labels in [`Self::name`], this signature is covering a + /// If this is less than the number of labels in [`self.name`], this signature is covering a /// wildcard entry. pub labels: u8, /// The TTL of the records which this [`RRSig`] is signing. @@ -471,7 +471,11 @@ pub struct RRSig { pub key_tag: u16, /// The [`DnsKey::name`] in the [`DnsKey`] which created this signature. /// - /// This must be a parent of the [`Self::name`]. + /// This must be a parent of [`self.name`]. + /// + /// [`DnsKey::name`]: Record::name + // We'd like to just link to the `DnsKey` member variable called `name`, but there doesn't + // appear to be a way to actually do that, so instead we have to link to the trait method. pub key_name: Name, /// The signature itself. pub signature: Vec, @@ -578,7 +582,7 @@ pub struct NS { /// This is also the zone which the server at [`Self::name_server`] is responsible for handling /// queries for. pub name: Name, - /// The name of the server which is responsible for handling queries for the [`Self::name`] + /// The name of the server which is responsible for handling queries for the [`self.name`] /// zone. pub name_server: Name, } diff --git a/src/validation.rs b/src/validation.rs index 7b2fab9..ae0bb58 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -209,7 +209,7 @@ pub struct VerifiedRRStream<'a> { /// The set of verified [`RR`]s. /// /// These are not valid unless the current UNIX time is between [`Self::valid_from`] and - /// [`Self::expiration`]. + /// [`Self::expires`]. pub verified_rrs: Vec<&'a RR>, /// The latest [`RRSig::inception`] of all the [`RRSig`]s validated to verify /// [`Self::verified_rrs`]. @@ -253,8 +253,8 @@ fn resolve_time(time: u32) -> u64 { /// All records which could be validated are returned, though if an error is found validating any /// contained record, only `Err` will be returned. /// -/// You MUST check that the current UNIX time is between [`VerifiedRRStream::latest_inception`] and -/// [`VerifiedRRStream::earliest_expiry`]. +/// You MUST check that the current UNIX time is between [`VerifiedRRStream::valid_from`] and +/// [`VerifiedRRStream::expires`]. pub fn verify_rr_stream<'a>(inp: &'a [RR]) -> Result, ValidationError> { let mut zone = "."; let mut res = Vec::new(); diff --git a/test.sh b/test.sh index 3346b74..240c0b6 100755 --- a/test.sh +++ b/test.sh @@ -9,3 +9,4 @@ cargo build --lib cargo build --lib --features std cargo build --lib --features tokio cargo build --bin http_proof_gen --features build_server +cargo doc --features std,tokio,validation -- 2.30.2