From fd52e266c6e25999a49c36f17342977b759a2612 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 13 Mar 2022 15:20:03 +0100 Subject: apply clippy suggestions --- planetwars-matchrunner/src/match_context.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'planetwars-matchrunner/src/match_context.rs') diff --git a/planetwars-matchrunner/src/match_context.rs b/planetwars-matchrunner/src/match_context.rs index 6ea60c3..1dac09b 100644 --- a/planetwars-matchrunner/src/match_context.rs +++ b/planetwars-matchrunner/src/match_context.rs @@ -57,11 +57,11 @@ impl MatchCtx { timeout, }); - return Request { + Request { player_id, request_id, event_bus: self.event_bus.clone(), - }; + } } pub fn players(&self) -> Vec { @@ -97,6 +97,12 @@ impl EventBus { } } +impl Default for EventBus { + fn default() -> Self { + EventBus::new() + } +} + impl EventBus { pub fn resolve_request(&mut self, id: RequestId, result: RequestResult>) { if self.request_responses.contains_key(&id) { @@ -138,9 +144,9 @@ impl Future for Request { event_bus .wakers .entry(request_id) - .or_insert_with(|| AtomicWaker::new()) + .or_insert_with(AtomicWaker::new) .register(cx.waker()); - return Poll::Pending; + Poll::Pending } } -- cgit v1.2.3