forked from darfink/tap-rs
-
Notifications
You must be signed in to change notification settings - Fork 19
Redundant type parameters in deref methods #11
Copy link
Copy link
Open
Description
Currently, pipe_deref is defined like so:
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a + Sized,
{ ... }The type parameter T here is redundant as it is essentially an alias for <Self as Deref>::Target.
pipe_deref can be rewritten as:
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R
where
Self: Deref,
Self::Target: 'a,
R: 'a + Sized,
{ ... }(This goes for tap_deref as well as these methods' mutable counterparts.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels