From d0e257df8523b0fa87fa3277cc04ee348c4023ed Mon Sep 17 00:00:00 2001 From: ranfdev Date: Sat, 26 Sep 2020 22:43:40 +0200 Subject: [PATCH] use std::convert::TryInto instead of using crate --- Cargo.toml | 1 - src/apps.rs | 12 ++---------- src/registration.rs | 4 ++-- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 82f7ce8..48bfacd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ serde_qs = "0.6.0" url = "2.1.1" tap-reader = "1" toml = { version = "0.5.0", optional = true } -try_from = "0.3.2" tungstenite = "0.11.0" [dependencies.chrono] diff --git a/src/apps.rs b/src/apps.rs index d54525a..e6129a1 100644 --- a/src/apps.rs +++ b/src/apps.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use serde::Serialize; -use try_from::TryInto; +use std::convert::TryInto; use crate::{ errors::{Error, Result}, @@ -132,16 +132,8 @@ impl<'a> AppBuilder<'a> { } } -impl TryInto for App { - type Err = Error; - - fn try_into(self) -> Result { - Ok(self) - } -} - impl<'a> TryInto for AppBuilder<'a> { - type Err = Error; + type Error = Error; fn try_into(self) -> Result { Ok(self.build()?) diff --git a/src/registration.rs b/src/registration.rs index 5379e87..22228ad 100644 --- a/src/registration.rs +++ b/src/registration.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use reqwest::blocking::{Client, RequestBuilder, Response}; use serde::Deserialize; -use try_from::TryInto; +use std::convert::TryInto; use crate::{ apps::{App, AppBuilder}, @@ -125,7 +125,7 @@ impl<'a> Registration<'a> { /// ``` pub fn register>(&mut self, app: I) -> Result where - Error: From<>::Err>, + Error: From<>::Error>, { let app = app.try_into()?; let oauth = self.send_app(&app)?;