From 990cce7267dae9bdd37ef772db2edeef2a39365b Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Fri, 22 Jan 2021 21:11:48 -0500 Subject: Use Tokio 1 (#306) * upgrade all the things Signed-off-by: Christine Dodrill * build(deps): bump serde from 1.0.118 to 1.0.120 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.118 to 1.0.120. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.118...v1.0.120) Signed-off-by: dependabot-preview[bot] * fix Signed-off-by: Christine Dodrill Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- src/app/poke.rs | 2 +- src/handlers/mod.rs | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/app/poke.rs b/src/app/poke.rs index dd6f9fe..eddb85e 100644 --- a/src/app/poke.rs +++ b/src/app/poke.rs @@ -1,6 +1,6 @@ use color_eyre::eyre::Result; use std::{env, time::Duration}; -use tokio::time::delay_for; +use tokio::time::sleep as delay_for; #[instrument(err)] pub async fn the_cloud() -> Result<()> { diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index d180a11..c6dbd65 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -5,11 +5,11 @@ use crate::{ use lazy_static::lazy_static; use prometheus::{opts, register_int_counter_vec, IntCounterVec}; use std::{convert::Infallible, fmt, sync::Arc}; +use tracing::instrument; use warp::{ http::{Response, StatusCode}, Rejection, Reply, }; -use tracing::instrument; lazy_static! { static ref HIT_COUNTER: IntCounterVec = @@ -86,12 +86,6 @@ impl fmt::Display for PostNotFound { impl warp::reject::Reject for PostNotFound {} -impl From for warp::reject::Rejection { - fn from(error: PostNotFound) -> Self { - warp::reject::custom(error) - } -} - #[derive(Debug, thiserror::Error)] struct SeriesNotFound(String); @@ -103,12 +97,6 @@ impl fmt::Display for SeriesNotFound { impl warp::reject::Reject for SeriesNotFound {} -impl From for warp::reject::Rejection { - fn from(error: SeriesNotFound) -> Self { - warp::reject::custom(error) - } -} - lazy_static! { static ref REJECTION_COUNTER: IntCounterVec = register_int_counter_vec!( opts!("rejections", "Number of rejections by kind"), -- cgit v1.2.3