Skip to content

Commit 2db78b7

Browse files
authored
Merge pull request #238 from epage/primary
docs: Describe Origin::primary
2 parents 5218ce0 + 838537f commit 2db78b7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/snippet.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ impl<'a> Annotation<'a> {
267267
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
268268
#[non_exhaustive]
269269
pub enum AnnotationKind {
270-
/// Match the primary [`Level`] of the group.
270+
/// Shows the source that the [Group's Title][Group::with_title] references
271271
///
272-
/// See [`Group::with_level`] for details about how this is determined
272+
/// For [`Title`]-less groups, see [`Group::with_level`]
273273
Primary,
274274
/// Additional context to explain the [`Primary`][Self::Primary]
275275
/// [`Annotation`]
@@ -396,17 +396,13 @@ impl<'a> Origin<'a> {
396396
}
397397

398398
/// Set the default line number to display
399-
///
400-
/// Otherwise this will be inferred from the primary [`Annotation`]
401399
pub fn line(mut self, line: usize) -> Self {
402400
self.line = Some(line);
403401
self
404402
}
405403

406404
/// Set the default column to display
407405
///
408-
/// Otherwise this will be inferred from the primary [`Annotation`]
409-
///
410406
/// <div class="warning">
411407
///
412408
/// `char_column` is only be respected if [`Origin::line`] is also set.
@@ -417,6 +413,7 @@ impl<'a> Origin<'a> {
417413
self
418414
}
419415

416+
/// Mark this as the source that the [Group's Title][Group::with_title] references
420417
pub fn primary(mut self, primary: bool) -> Self {
421418
self.primary = primary;
422419
self

0 commit comments

Comments
 (0)