use std::convert::TryInto instead of using crate

master
ranfdev 4 years ago committed by Paul Woolcock
parent 83587a10d2
commit d0e257df85
  1. 1
      Cargo.toml
  2. 12
      src/apps.rs
  3. 4
      src/registration.rs

@ -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]

@ -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()?)

@ -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)?;

Loading…
Cancel
Save