diff --git a/Cargo.toml b/Cargo.toml index 3d9a28c4..e7805e12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ hyper-util = { version = "0.1.3", features = ["http1"] } once_cell = "1.7.2" percent-encoding = "2.2.0" pin-project = "1.0.12" -secrecy = "0.8.0" +secrecy = "0.10.3" serde = { version = "1.0.126", features = ["derive"] } serde_json = "1.0.64" serde_path_to_error = "0.1.4" diff --git a/examples/device_flow.rs b/examples/device_flow.rs index 1903fe38..44b807c4 100644 --- a/examples/device_flow.rs +++ b/examples/device_flow.rs @@ -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()) diff --git a/examples/get_dependabot_alerts.rs b/examples/get_dependabot_alerts.rs index 7b3102b7..226c78f6 100644 --- a/examples/get_dependabot_alerts.rs +++ b/examples/get_dependabot_alerts.rs @@ -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() diff --git a/src/lib.rs b/src/lib.rs index 4a5cf766..6f8220a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1544,7 +1544,7 @@ impl Octocrab { token.set(token_object.token.clone(), expiration); - Ok(SecretString::new(token_object.token)) + Ok(SecretString::from(token_object.token)) } /// Send the given request to the underlying service