From 1086de7bff281e7d428d5af989cb6e4e0f55a85c Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Tue, 30 Jul 2019 11:14:12 -0700 Subject: [PATCH] refactor: simplify srv usage --- autopush/src/client.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/autopush/src/client.rs b/autopush/src/client.rs index 90aedbbd3..fa8f7bcd2 100644 --- a/autopush/src/client.rs +++ b/autopush/src/client.rs @@ -856,13 +856,11 @@ where let uaid = webpush.uaid; let message_month = webpush.message_month.clone(); - let srv = data.srv.clone(); + let srv = &data.srv; let fut = match srv.make_endpoint(&uaid, &channel_id, key.clone()) { - Ok(endpoint) => { - data.srv - .ddb - .register(&uaid, &channel_id, &message_month, &endpoint) - } + Ok(endpoint) => srv + .ddb + .register(&uaid, &channel_id, &message_month, &endpoint), Err(_) => Box::new(future::ok(RegisterResponse::Error { error_msg: "Failed to generate endpoint".to_string(), status: 400,