From 07c8ac44edb595ca189da6360237abb918cf1fcb Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 12 Sep 2023 22:40:38 -0600 Subject: [PATCH] Ignore needless_doctest_main clippy lint warning: needless `fn main` in doctest --> unindent/src/lib.rs:24:5 | 24 | //! use unindent::unindent; | _____^ 25 | | //! 26 | | //! fn main() { 27 | | //! let indented = " ... | 30 | | //! assert_eq!("line one\nline two", unindent(indented)); 31 | | //! } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main = note: `-W clippy::needless-doctest-main` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_doctest_main)]` warning: needless `fn main` in doctest --> unindent/src/lib.rs:38:5 | 38 | //! use unindent::Unindent; | _____^ 39 | | //! 40 | | //! fn main() { 41 | | //! let indented = format!(" ... | 44 | | //! assert_eq!("line one\nline two", indented.unindent()); 45 | | //! } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main --- unindent/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/unindent/src/lib.rs b/unindent/src/lib.rs index cbf7e02..83513ad 100644 --- a/unindent/src/lib.rs +++ b/unindent/src/lib.rs @@ -50,6 +50,7 @@ clippy::missing_panics_doc, clippy::module_name_repetitions, clippy::must_use_candidate, + clippy::needless_doctest_main, clippy::trivially_copy_pass_by_ref, clippy::type_complexity )]