Skip to content

Commit

Permalink
Improve rendering of inline code in macros documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 18, 2024
1 parent 8ce4560 commit 0f74169
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/// Return early with an error.
///
/// This macro is equivalent to `return Err(`[`anyhow!($args...)`][anyhow!]`)`.
/// This macro is equivalent to
/// <code>return Err([anyhow!($args\...)][anyhow!])</code>.
///
/// The surrounding function's or closure's return value is required to be
/// `Result<_,`[`anyhow::Error`][crate::Error]`>`.
/// <code>Result&lt;_, [anyhow::Error][crate::Error]&gt;</code>.
///
/// [anyhow!]: crate::anyhow
///
Expand Down Expand Up @@ -69,11 +70,11 @@ macro_rules! __ensure {
($ensure:item) => {
/// Return early with an error if a condition is not satisfied.
///
/// This macro is equivalent to `if !$cond { return
/// Err(`[`anyhow!($args...)`][anyhow!]`); }`.
/// This macro is equivalent to
/// <code>if !$cond { return Err([anyhow!($args\...)][anyhow!]); }</code>.
///
/// The surrounding function's or closure's return value is required to be
/// `Result<_,`[`anyhow::Error`][crate::Error]`>`.
/// <code>Result&lt;_, [anyhow::Error][crate::Error]&gt;</code>.
///
/// Analogously to `assert!`, `ensure!` takes a condition and exits the function
/// if the condition fails. Unlike `assert!`, `ensure!` returns an `Error`
Expand Down

0 comments on commit 0f74169

Please sign in to comment.