From 82773497ab0c6c27ec64edf60a1a7137028c8f21 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 1 Jul 2025 16:43:07 -0500 Subject: [PATCH 1/2] docs: Remove bad comments about Origin --- src/snippet.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/snippet.rs b/src/snippet.rs index 3045b2a..a58c32a 100644 --- a/src/snippet.rs +++ b/src/snippet.rs @@ -396,8 +396,6 @@ impl<'a> Origin<'a> { } /// Set the default line number to display - /// - /// Otherwise this will be inferred from the primary [`Annotation`] pub fn line(mut self, line: usize) -> Self { self.line = Some(line); self @@ -405,8 +403,6 @@ impl<'a> Origin<'a> { /// Set the default column to display /// - /// Otherwise this will be inferred from the primary [`Annotation`] - /// ///
/// /// `char_column` is only be respected if [`Origin::line`] is also set. From 838537fd5fdce918075865c168f683883f5f15c6 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 1 Jul 2025 16:45:36 -0500 Subject: [PATCH 2/2] docs: Describe Origin::primary --- src/snippet.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/snippet.rs b/src/snippet.rs index a58c32a..851a55f 100644 --- a/src/snippet.rs +++ b/src/snippet.rs @@ -267,9 +267,9 @@ impl<'a> Annotation<'a> { #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] #[non_exhaustive] pub enum AnnotationKind { - /// Match the primary [`Level`] of the group. + /// Shows the source that the [Group's Title][Group::with_title] references /// - /// See [`Group::with_level`] for details about how this is determined + /// For [`Title`]-less groups, see [`Group::with_level`] Primary, /// Additional context to explain the [`Primary`][Self::Primary] /// [`Annotation`] @@ -413,6 +413,7 @@ impl<'a> Origin<'a> { self } + /// Mark this as the source that the [Group's Title][Group::with_title] references pub fn primary(mut self, primary: bool) -> Self { self.primary = primary; self