Skip to content

Commit

Permalink
Remove redundant id field in subscription::Map
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 5, 2024
1 parent 35bbee5 commit 2fb271a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions futures/src/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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 }
}
}

Expand All @@ -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);
}

Expand Down

0 comments on commit 2fb271a

Please sign in to comment.