From 87c7d7b5d613d9cbb1a4c9090c93f9e0b608dc65 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 5 Aug 2023 16:36:47 +0900 Subject: [PATCH] Fix noop_method_call warning in doctest ``` error: call to `.clone()` on a reference in this situation does nothing --> crossbeam-epoch/src/guard.rs:451:38 | 14 | let dummy = &epoch::unprotected().clone(); | ^^^^^^^^ help: remove this redundant call | = note: the type `Guard` does not implement `Clone`, so calling `clone` on `&Guard` copies the reference, which does not do anything and can be removed note: the lint level is defined here --> crossbeam-epoch/src/guard.rs:438:9 | 1 | #![deny(warnings, rust_2018_idioms)] | ^^^^^^^^ = note: `#[deny(noop_method_call)]` implied by `#[deny(warnings)]` ``` --- crossbeam-epoch/src/guard.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crossbeam-epoch/src/guard.rs b/crossbeam-epoch/src/guard.rs index ba7fe1b11..da1c5c01b 100644 --- a/crossbeam-epoch/src/guard.rs +++ b/crossbeam-epoch/src/guard.rs @@ -447,8 +447,8 @@ impl fmt::Debug for Guard { /// // Load `a` without pinning the current thread. /// a.load(Relaxed, epoch::unprotected()); /// -/// // It's possible to create more dummy guards by calling `clone()`. -/// let dummy = &epoch::unprotected().clone(); +/// // It's possible to create more dummy guards. +/// let dummy = epoch::unprotected(); /// /// dummy.defer(move || { /// println!("This gets executed immediately.");