Skip to content

Commit

Permalink
closures/exercise.rs: drop trait bounds from struct definition (googl…
Browse files Browse the repository at this point in the history
…e#2649)

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.
  • Loading branch information
fw-immunant authored Feb 20, 2025
1 parent e16dc70 commit 63cc474
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/closures/exercise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ impl Logger for StderrLogger {
// ANCHOR_END: setup

/// Only log messages matching a filtering predicate.
struct Filter<L, P>
where
L: Logger,
P: Fn(u8, &str) -> bool,
{
struct Filter<L, P> {
inner: L,
predicate: P,
}
Expand Down

0 comments on commit 63cc474

Please sign in to comment.