From 0f741692fada86f809898c3341d5b3fac1a7550b Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 18 Oct 2024 07:37:21 -0700 Subject: [PATCH] Improve rendering of inline code in macros documentation --- src/macros.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index a0671ac..469b3d8 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,9 +1,10 @@ /// Return early with an error. /// -/// This macro is equivalent to `return Err(`[`anyhow!($args...)`][anyhow!]`)`. +/// This macro is equivalent to +/// return Err([anyhow!($args\...)][anyhow!]). /// /// The surrounding function's or closure's return value is required to be -/// `Result<_,`[`anyhow::Error`][crate::Error]`>`. +/// Result<_, [anyhow::Error][crate::Error]>. /// /// [anyhow!]: crate::anyhow /// @@ -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 + /// if !$cond { return Err([anyhow!($args\...)][anyhow!]); }. /// /// The surrounding function's or closure's return value is required to be - /// `Result<_,`[`anyhow::Error`][crate::Error]`>`. + /// Result<_, [anyhow::Error][crate::Error]>. /// /// Analogously to `assert!`, `ensure!` takes a condition and exits the function /// if the condition fails. Unlike `assert!`, `ensure!` returns an `Error`