Remove redundant id field in subscription::Map
This commit is contained in:
parent
35bbee501f
commit
2fb271a976
1 changed files with 2 additions and 7 deletions
|
|
@ -160,7 +160,6 @@ struct Map<A, B, F>
|
||||||
where
|
where
|
||||||
F: Fn(A) -> B + 'static,
|
F: Fn(A) -> B + 'static,
|
||||||
{
|
{
|
||||||
id: TypeId,
|
|
||||||
recipe: Box<dyn Recipe<Output = A>>,
|
recipe: Box<dyn Recipe<Output = A>>,
|
||||||
mapper: F,
|
mapper: F,
|
||||||
}
|
}
|
||||||
|
|
@ -170,11 +169,7 @@ where
|
||||||
F: Fn(A) -> B + 'static,
|
F: Fn(A) -> B + 'static,
|
||||||
{
|
{
|
||||||
fn new(recipe: Box<dyn Recipe<Output = A>>, mapper: F) -> Self {
|
fn new(recipe: Box<dyn Recipe<Output = A>>, mapper: F) -> Self {
|
||||||
Map {
|
Map { recipe, mapper }
|
||||||
id: TypeId::of::<F>(),
|
|
||||||
recipe,
|
|
||||||
mapper,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -187,7 +182,7 @@ where
|
||||||
type Output = B;
|
type Output = B;
|
||||||
|
|
||||||
fn hash(&self, state: &mut Hasher) {
|
fn hash(&self, state: &mut Hasher) {
|
||||||
self.id.hash(state);
|
TypeId::of::<F>().hash(state);
|
||||||
self.recipe.hash(state);
|
self.recipe.hash(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue