Allow unused in `macros.rs` docs
The example code in macros.rs is much clearer as it is than changing it to remove the warnings created by adding the warn attribute to the `lib.rs` file. The example code was enclosed within a function block and `#[allow(unused)]` added. And a warn attribute added to `lib.rs`.
This commit is contained in:
parent
fd89ddf401
commit
f6abdcc001
|
@ -10,6 +10,7 @@
|
|||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
// Coding conventions.
|
||||
#![warn(missing_docs)]
|
||||
#![doc(test(attr(warn(unused))))]
|
||||
// Exclude lints we don't think are valuable.
|
||||
#![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134
|
||||
#![allow(clippy::manual_range_contains)] // More readable than clippy's format.
|
||||
|
|
|
@ -158,6 +158,8 @@ macro_rules! const_assert {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// # #[allow(unused)]
|
||||
/// # fn main() {
|
||||
/// # use core::fmt::{Display, Debug};
|
||||
/// use bitcoin_internals::impl_from_infallible;
|
||||
///
|
||||
|
@ -167,7 +169,7 @@ macro_rules! const_assert {
|
|||
/// enum BetaEnum<'b> { Item(&'b usize) }
|
||||
/// impl_from_infallible!(BetaEnum<'b>);
|
||||
///
|
||||
/// enum GammaEnum<T> { Item(T) };
|
||||
/// enum GammaEnum<T> { Item(T) }
|
||||
/// impl_from_infallible!(GammaEnum<T>);
|
||||
///
|
||||
/// enum DeltaEnum<'b, 'a: 'static + 'b, T: 'a, D: Debug + Display + 'a> {
|
||||
|
@ -189,6 +191,7 @@ macro_rules! const_assert {
|
|||
/// what: &'b D,
|
||||
/// }
|
||||
/// impl_from_infallible!(DeltaStruct<'b, 'a: 'static + 'b, T: 'a, D: Debug + Display + 'a>);
|
||||
/// # }
|
||||
/// ```
|
||||
///
|
||||
/// See <https://stackoverflow.com/a/61189128> for more information about this macro.
|
||||
|
|
Loading…
Reference in New Issue