From 5ae2fdf0e941b3ce13ad35363398782381179dad Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Fri, 19 Feb 2021 00:31:05 +0000 Subject: Update crates tu use async all the way --- src/errors.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 544c391..d935c49 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,17 +1,17 @@ use rocket::http::ContentType; use rocket::request::Request; use rocket::response::{self, Responder, Response}; -use rspotify::client::ApiError; -use rspotify::oauth2::SpotifyOAuth; +use rspotify::client::ClientError; +use rspotify::client::Spotify; use std::collections::HashMap; use std::io::Cursor; use std::sync::{MutexGuard, PoisonError}; -use tokio_postgres::error::Error as DbError; +use tokio_postgres::Error as DbError; #[derive(Debug)] pub enum Error { Postgres(DbError), - Spotify(ApiError), + Spotify(ClientError), Misc(String), } impl From for Error { @@ -19,8 +19,8 @@ impl From for Error { Error::Postgres(error) } } -impl From for Error { - fn from(error: ApiError) -> Self { +impl From for Error { + fn from(error: ClientError) -> Self { Error::Spotify(error) } } @@ -34,13 +34,13 @@ impl From for Error { Error::Misc(error) } } -impl<'a> From>>> for Error { - fn from(error: PoisonError>>) -> Self { +impl<'a> From>>> for Error { + fn from(error: PoisonError>>) -> Self { Error::Misc(format!("failed to lock the client mutex: {:?}", error)) } } -impl<'a> From>> for Error { - fn from(error: PoisonError>) -> Self { +impl<'a> From>> for Error { + fn from(error: PoisonError>) -> Self { Error::Misc(format!("failed to lock the client mutex: {:?}", error)) } } -- cgit v1.2.3-70-g09d2