Skip to content

Commit

Permalink
fix docs typo
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynzech committed Sep 25, 2024
1 parent 399abaa commit c698f1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/contracts/safety/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ mod tool;
/// # Example
///
/// ```ignore
/// #[invariant(width == height)]
/// #[invariant(self.width == self.height)]
/// struct Square {
/// width: u32,
/// height: u32,
/// }
/// ```
///
/// expands to:
/// ```ignore
/// impl core::ub_checks::Invariant for Square {
/// fn is_safe(&self) -> bool {
/// width == height
/// self.width == self.height
/// }
/// }
/// ```
Expand All @@ -60,7 +61,6 @@ pub fn invariant(attr: TokenStream, item: TokenStream) -> TokenStream {
proc_macro::TokenStream::from(expanded)
}

///
/// Expands the derive macro for the Invariant trait.
/// The macro expands to an implementation of the `is_safe` method for the `Invariant` trait.
/// This macro is only supported for structs.
Expand All @@ -74,6 +74,7 @@ pub fn invariant(attr: TokenStream, item: TokenStream) -> TokenStream {
/// height: u32,
/// }
/// ```
///
/// expands to:
/// ```ignore
/// impl core::ub_checks::Invariant for Square {
Expand Down

0 comments on commit c698f1c

Please sign in to comment.