From b1a8db2a765fb4ff7d9fac1051d050378efbfa30 Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Wed, 19 Feb 2025 01:42:11 +0000 Subject: [PATCH] closures/exercise.rs: drop trait bounds from struct definition This is more idiomatic than what we had before. We keep the trait bounds for the inherent impl, because the new method can use them to guide inference of unannotated closure arguments. --- src/closures/exercise.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/closures/exercise.rs b/src/closures/exercise.rs index e6951257b128..3db9b6602681 100644 --- a/src/closures/exercise.rs +++ b/src/closures/exercise.rs @@ -29,11 +29,7 @@ impl Logger for StderrLogger { // ANCHOR_END: setup /// Only log messages matching a filtering predicate. -struct Filter -where - L: Logger, - P: Fn(u8, &str) -> bool, -{ +struct Filter { inner: L, predicate: P, }