Skip to content

Commit

Permalink
doc: Explicitly spell out constructor
Browse files Browse the repository at this point in the history
As this is expected to be used by newcomers, it helps being explicit.
  • Loading branch information
chrysn committed Sep 4, 2024
1 parent e37cbe7 commit 7508aeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<const I: u8> LED<I> {
Self::new_unchecked()
}

/// Accesses the LED numbered `I`.
/// Accesses the LED numbered `I` as `LED::<I>::new_unchecked()`.
///
/// It is not an error if this board does not have a LED with that number; the resulting struct
/// will be available but its methods have no effect.
Expand All @@ -32,7 +32,7 @@ impl<const I: u8> LED<I> {
Self(())
}

/// Accesses the LED numbered `I`.
/// Accesses the LED numbered `I` as `LED::<I>::new_checked()?`.
///
/// An LED is returned if present on the board, which is known at build time.
pub const fn new_checked() -> Result<Self, LedNotPresent> {
Expand Down

0 comments on commit 7508aeb

Please sign in to comment.