chore: remove unused From implementations for TrelloAuth
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 2m13s
Test / build (map[name:stable]) (push) Successful in 2m9s
Release Please / Release-plz (push) Failing after 19s

This commit is contained in:
Paul Campbell 2024-12-15 15:02:56 +00:00
parent 7fd074a45a
commit 20e3c80da2

View file

@ -1,9 +1,7 @@
use std::collections::HashMap;
// //
use derive_more::derive::Display; use derive_more::derive::Display;
use crate::newtype; use crate::newtype;
use crate::trello::TrelloConfig;
newtype!(TrelloApiKey, String, Display, PartialOrd, Ord, "API Key"); newtype!(TrelloApiKey, String, Display, PartialOrd, Ord, "API Key");
newtype!( newtype!(
@ -20,22 +18,3 @@ pub(crate) struct TrelloAuth<'cfg> {
pub(crate) api_key: &'cfg TrelloApiKey, pub(crate) api_key: &'cfg TrelloApiKey,
pub(crate) api_secret: &'cfg TrelloApiSecret, 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
),
)])
}
}