Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secrecy dependency update from 0.8.0 to 0.10.3 #718

Merged
merged 4 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Examples update. Change SecretString::new to SecretString::from
vlad1slav committed Oct 10, 2024
commit 3799bf70347094aadf327b854edbc28fc2d7c7a3
2 changes: 1 addition & 1 deletion examples/device_flow.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ use http::header::ACCEPT;

#[tokio::main]
async fn main() -> octocrab::Result<()> {
let client_id = secrecy::Secret::from(std::env::var("GITHUB_CLIENT_ID").unwrap());
let client_id = secrecy::SecretString::from(std::env::var("GITHUB_CLIENT_ID").unwrap());
let crab = octocrab::Octocrab::builder()
.base_uri("https://github.com")?
.add_header(ACCEPT, "application/json".to_string())
2 changes: 1 addition & 1 deletion examples/get_dependabot_alerts.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ const REPO: &str = "some-repo";
#[tokio::main]
async fn main() {
// example for Dependabot alerts API with OAuth GitHub App
let client_id = secrecy::Secret::from(std::env::var("GITHUB_CLIENT_ID").unwrap());
let client_id = secrecy::SecretString::from(std::env::var("GITHUB_CLIENT_ID").unwrap());
let crab = octocrab::Octocrab::builder()
.base_uri("https://github.com")
.unwrap()
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1544,7 +1544,7 @@ impl Octocrab {

token.set(token_object.token.clone(), expiration);

Ok(SecretString::new(token_object.token.into()))
Ok(SecretString::from(token_object.token))
}

/// Send the given request to the underlying service