chore: remove unused From implementations for TrelloAuth
This commit is contained in:
parent
7fd074a45a
commit
20e3c80da2
1 changed files with 0 additions and 21 deletions
|
@ -1,9 +1,7 @@
|
|||
use std::collections::HashMap;
|
||||
//
|
||||
use derive_more::derive::Display;
|
||||
|
||||
use crate::newtype;
|
||||
use crate::trello::TrelloConfig;
|
||||
|
||||
newtype!(TrelloApiKey, String, Display, PartialOrd, Ord, "API Key");
|
||||
newtype!(
|
||||
|
@ -20,22 +18,3 @@ pub(crate) struct TrelloAuth<'cfg> {
|
|||
pub(crate) api_key: &'cfg TrelloApiKey,
|
||||
pub(crate) api_secret: &'cfg TrelloApiSecret,
|
||||
}
|
||||
impl<'cfg> From<&'cfg TrelloConfig> for TrelloAuth<'cfg> {
|
||||
fn from(value: &'cfg TrelloConfig) -> Self {
|
||||
TrelloAuth {
|
||||
api_key: &value.api_key,
|
||||
api_secret: &value.api_secret,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl From<TrelloAuth<'_>> for HashMap<String, String> {
|
||||
fn from(value: TrelloAuth) -> Self {
|
||||
HashMap::from([(
|
||||
"Authorization".into(),
|
||||
format!(
|
||||
r#"OAuth oauth_consumer_key="{}", oauth_token="{}""#,
|
||||
value.api_key, value.api_secret
|
||||
),
|
||||
)])
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue