diff --git a/src/api/checks.rs b/src/api/checks.rs index a722be65..79d95d2b 100644 --- a/src/api/checks.rs +++ b/src/api/checks.rs @@ -1,5 +1,4 @@ use chrono::{DateTime, Utc}; -use hyper::body::Body; use crate::models::checks::{AutoTriggerCheck, CheckSuite, CheckSuitePreferences}; use crate::models::{AppId, CheckRunId, CheckSuiteId}; diff --git a/src/lib.rs b/src/lib.rs index 7b614d06..cab6fc12 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -521,8 +521,8 @@ impl OctocrabBuilder } /// Add a personal token to use for authentication. - pub fn personal_token(mut self, token: String) -> Self { - self.config.auth = Auth::PersonalToken(SecretString::new(token)); + pub fn personal_token>(mut self, token: S) -> Self { + self.config.auth = Auth::PersonalToken(token.into()); self } @@ -547,8 +547,8 @@ impl OctocrabBuilder } /// Authenticate with a user access token. - pub fn user_access_token(mut self, token: String) -> Self { - self.config.auth = Auth::UserAccessToken(SecretString::new(token)); + pub fn user_access_token>(mut self, token: S) -> Self { + self.config.auth = Auth::UserAccessToken(token.into()); self } @@ -834,9 +834,8 @@ impl CachedToken { self.valid_token_with_buffer(chrono::Duration::seconds(30)) } - fn set(&self, token: String, expiration: Option>) { - *self.0.write().unwrap() = - Some(CachedTokenInner::new(SecretString::new(token), expiration)); + fn set>(&self, token: S, expiration: Option>) { + *self.0.write().unwrap() = Some(CachedTokenInner::new(token.into(), expiration)); } }