Skip to content

Commit

Permalink
x509-cert: document add_extension link to examples
Browse files Browse the repository at this point in the history
This makes `add_extension` link back to the example provided in
`AsExtension`.

Fixes #1490
  • Loading branch information
baloo committed Sep 10, 2024
1 parent 320ee91 commit 459a28a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x509-cert/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ where
}

/// Add an extension to this certificate
///
/// Extensions need to implement [`AsExtension`], examples may be found in
/// in [`AsExtension` documentation](../ext/trait.AsExtension.html#examples) or
/// [the implementors](../ext/trait.AsExtension.html#implementors).
pub fn add_extension<E: AsExtension>(&mut self, extension: &E) -> Result<()> {
let ext = extension.to_extension(&self.tbs.subject, &self.extensions)?;
self.extensions.push(ext);
Expand Down Expand Up @@ -265,6 +269,10 @@ impl RequestBuilder {
}

/// Add an extension to this certificate request
///
/// Extensions need to implement [`AsExtension`], examples may be found in
/// in [`AsExtension` documentation](../ext/trait.AsExtension.html#examples) or
/// [the implementors](../ext/trait.AsExtension.html#implementors).
pub fn add_extension<E: AsExtension>(&mut self, extension: &E) -> Result<()> {
let ext = extension.to_extension(&self.info.subject, &self.extension_req.0)?;

Expand Down

0 comments on commit 459a28a

Please sign in to comment.