diff options
author | ranfdev <ranfdev@gmail.com> | 2020-09-26 22:43:40 +0200 |
---|---|---|
committer | Paul Woolcock <paul@woolcock.us> | 2020-09-29 23:07:59 -0400 |
commit | d0e257df8523b0fa87fa3277cc04ee348c4023ed (patch) | |
tree | f5f79f1689ffb0130c4de297df0b9d5082442f55 | |
parent | 83587a10d2c7667360b2846a0601df2bc48c9677 (diff) |
use std::convert::TryInto instead of using crate
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/apps.rs | 12 | ||||
-rw-r--r-- | src/registration.rs | 4 |
3 files changed, 4 insertions, 13 deletions
@@ -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<App> for App { - type Err = Error; - - fn try_into(self) -> Result<App> { - Ok(self) - } -} - impl<'a> TryInto<App> for AppBuilder<'a> { - type Err = Error; + type Error = Error; fn try_into(self) -> Result<App> { 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<I: TryInto<App>>(&mut self, app: I) -> Result<Registered> where - Error: From<<I as TryInto<App>>::Err>, + Error: From<<I as TryInto<App>>::Error>, { let app = app.try_into()?; let oauth = self.send_app(&app)?; |