From c9a02c2e427fa22c8a86f7818dcde17e53151c30 Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Sat, 29 Feb 2020 13:14:52 +0100 Subject: use .copied() instead of .map(|x| *x) on iterators --- src/libtest/test_result.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libtest') diff --git a/src/libtest/test_result.rs b/src/libtest/test_result.rs index bfa572c887a..5c975c6272b 100644 --- a/src/libtest/test_result.rs +++ b/src/libtest/test_result.rs @@ -40,7 +40,7 @@ pub fn calc_result<'a>( let maybe_panic_str = err .downcast_ref::() .map(|e| &**e) - .or_else(|| err.downcast_ref::<&'static str>().map(|e| *e)); + .or_else(|| err.downcast_ref::<&'static str>().copied()); if maybe_panic_str.map(|e| e.contains(msg)).unwrap_or(false) { TestResult::TrOk -- cgit 1.4.1-3-g733a5