mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-23 16:12:47 +02:00
closures/exercise.rs: drop trait bounds from struct definition (#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.
This commit is contained in:
parent
e16dc70903
commit
63cc474ba0
@ -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,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user