Skip to content

Commit

Permalink
Replace dotenv (unmaintained) with dotenvy
Browse files Browse the repository at this point in the history
`dotenv` is unmaintained and has not received an update since 2020. `dotenvy` is the recommended, drop in fork.

Sources:
1. https://github.com/dotenv-rs/dotenv
2. https://rustsec.org/advisories/RUSTSEC-2021-0141.html
  • Loading branch information
joshuamegnauth54 committed Nov 21, 2023
1 parent a3bd1c8 commit 1c95ab9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async-stream = { version = "0.3.2", optional = true }
async-trait = { version = "0.1.51", optional = true }
base64 = "0.21.2"
chrono = { version = "0.4.19", features = ["serde"] }
dotenv = { version = "0.15.0", optional = true }
dotenvy = { version = "0.15.0", optional = true }
futures = { version = "0.3.17", optional = true }
getrandom = "0.2.3"
log = "0.4.14"
Expand All @@ -56,7 +56,7 @@ default = ["client-reqwest", "reqwest-default-tls"]

### Client ###
cli = ["webbrowser"]
env-file = ["dotenv"]
env-file = ["dotenvy"]

### HTTP ###
# Available clients. By default they don't include a TLS so that it can be
Expand All @@ -80,7 +80,7 @@ __sync = ["maybe-async/is_sync"]

[package.metadata.docs.rs]
# When generating the docs, we also want to include the CLI methods, and working
# links for `dotenv`. We generate them for ureq so that the function signatures
# links for `dotenvy`. We generate them for ureq so that the function signatures
# of the endpoints don't look gnarly (because of `async-trait`).
features = ["cli", "env-file", "client-ureq"]
no-default-features = true
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
//!
//! ### Environmental variables
//!
//! RSpotify supports the `dotenv` crate, which allows you to save credentials
//! RSpotify supports the `dotenvy` crate, which allows you to save credentials
//! in a `.env` file. These will then be automatically available as
//! environmental values when using methods like [`Credentials::from_env`].
//!
Expand Down Expand Up @@ -367,7 +367,7 @@ impl Credentials {
pub fn from_env() -> Option<Self> {
#[cfg(feature = "env-file")]
{
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
}

Some(Self {
Expand Down Expand Up @@ -422,7 +422,7 @@ impl OAuth {
pub fn from_env(scopes: HashSet<String>) -> Option<Self> {
#[cfg(feature = "env-file")]
{
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
}

Some(Self {
Expand Down

0 comments on commit 1c95ab9

Please sign in to comment.