Skip to content

Commit c20cc4a

Browse files
committed
Improve documentation
1 parent fb073ad commit c20cc4a

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/policy/builtin.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//! Built-in policies for Sigsum.
2+
//!
3+
//! This module contains all the included built-in policies. These can be accessed
4+
//! and used directly as public statics, or looked up at runtime by name via
5+
//! [`Policy::builtin`].
6+
17
use std::ops::Deref;
28
use std::sync::LazyLock;
39

@@ -18,7 +24,7 @@ pub struct BuiltInPolicy {
1824
}
1925

2026
impl BuiltInPolicy {
21-
/// Returns the policy for this built in policy. Can also be accessed
27+
/// Returns the policy for this built-in policy. Can also be accessed
2228
/// via the `Deref` implementation.
2329
pub fn policy(&self) -> &Policy {
2430
&self.policy
@@ -78,7 +84,7 @@ macro_rules! define_builtin_policies {
7884
};
7985
}
8086

81-
// All built in policies defined here in one single place.
87+
// All built-in policies defined here in one single place.
8288
// Multiple invocations not possible since this invocation emits the `builtin` lookup function.
8389
define_builtin_policies! {
8490
SIGSUM_TEST1_2025 = "sigsum-test1-2025",

src/policy/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub use parsing::ParsePolicyError;
1212
/// The Sigsum policy dictates if a signed tree head is considered valid (and by extension, if a
1313
/// Sigsum signature is valid).
1414
///
15-
/// This library contains a bunch of built in policies, ready for use in [`builtin`].
15+
/// This library contains a bunch of built-in policies, ready for use in [`builtin`].
1616
#[derive(Debug, Eq, PartialEq)]
1717
pub struct Policy {
1818
// logs keeps the list of log keys and URLs indexed by keyhash.
@@ -60,6 +60,8 @@ impl<'a> Iterator for Logs<'a> {
6060

6161
impl Policy {
6262
/// Returns a built-in policy by name, if one exists.
63+
///
64+
/// See [`builtin`] for public static definitions of these policies.
6365
pub fn builtin(name: &str) -> Option<&'static Self> {
6466
builtin::builtin(name)
6567
}

0 commit comments

Comments
 (0)