Skip to content

Commit

Permalink
closures/exercise.rs: drop trait bounds from struct definition
Browse files Browse the repository at this point in the history
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 committed Feb 20, 2025
1 parent 44a7974 commit b1a8db2
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 b1a8db2

Please sign in to comment.