forked from MightyPork/elefren-fork
use std::convert::TryInto instead of using crate
This commit is contained in:
@@ -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]
|
||||
|
||||
+2
-10
@@ -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
-2
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user