Remove redundant id field in subscription::Map

This commit is contained in:
Héctor Ramón Jiménez 2024-02-05 21:39:03 +01:00
parent 35bbee501f
commit 2fb271a976
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -160,7 +160,6 @@ struct Map<A, B, F>
where
F: Fn(A) -> B + 'static,
{
id: TypeId,
recipe: Box<dyn Recipe<Output = A>>,
mapper: F,
}
@ -170,11 +169,7 @@ where
F: Fn(A) -> B + 'static,
{
fn new(recipe: Box<dyn Recipe<Output = A>>, mapper: F) -> Self {
Map {
id: TypeId::of::<F>(),
recipe,
mapper,
}
Map { recipe, mapper }
}
}
@ -187,7 +182,7 @@ where
type Output = B;
fn hash(&self, state: &mut Hasher) {
self.id.hash(state);
TypeId::of::<F>().hash(state);
self.recipe.hash(state);
}