diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml index 4c2fb5a..317921b 100644 --- a/dotenv/Cargo.toml +++ b/dotenv/Cargo.toml @@ -16,17 +16,17 @@ readme = "../README.md" keywords = ["environment", "env", "dotenv", "settings", "config"] license = "MIT" repository = "https://github.com/dotenv-rs/dotenv" -edition = "2018" +edition = "2021" [[bin]] name = "dotenv" required-features = ["cli"] [dependencies] -clap = { version = "2", optional = true } +clap = { version = "3.0.6", optional = true } [dev-dependencies] -tempfile = "3.0.0" +tempfile = "3.3.0" [features] cli = ["clap"] diff --git a/dotenv/src/bin/dotenv.rs b/dotenv/src/bin/dotenv.rs index dce09c6..9a0aff5 100644 --- a/dotenv/src/bin/dotenv.rs +++ b/dotenv/src/bin/dotenv.rs @@ -29,13 +29,12 @@ fn make_command(name: &str, args: Vec<&str>) -> Command { fn main() { let matches = App::new("dotenv") .about("Run a command using the environment in a .env file") - .usage("dotenv [ARGS]...") + .override_usage("dotenv [ARGS]...") .setting(AppSettings::AllowExternalSubcommands) .setting(AppSettings::ArgRequiredElseHelp) - .setting(AppSettings::UnifiedHelpMessage) .arg( - Arg::with_name("FILE") - .short("f") + Arg::new("FILE") + .short('f') .long("file") .takes_value(true) .help("Use a specific .env file (defaults to .env)"), @@ -49,7 +48,7 @@ fn main() { .unwrap_or_else(|e| die!("error: failed to load environment: {}", e)); let mut command = match matches.subcommand() { - (name, Some(matches)) => { + Some((name, matches)) => { let args = matches .values_of("") .map(|v| v.collect()) diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs index f2b1b0a..9beb336 100644 --- a/dotenv/src/lib.rs +++ b/dotenv/src/lib.rs @@ -4,6 +4,7 @@ //! variables is not practical. It loads environment variables from a .env //! file, if available, and mashes those with the actual environment variables //! provided by the operating system. +#![forbid(unsafe_code)] mod errors; mod find; diff --git a/dotenv_codegen/Cargo.toml b/dotenv_codegen/Cargo.toml index 5227f0d..f3aae8a 100644 --- a/dotenv_codegen/Cargo.toml +++ b/dotenv_codegen/Cargo.toml @@ -15,8 +15,8 @@ license = "MIT" homepage = "https://github.com/dotenv-rs/dotenv" repository = "https://github.com/dotenv-rs/dotenv" description = "A `dotenv` implementation for Rust" -edition = "2018" +edition = "2021" [dependencies] -dotenv_codegen_implementation = { version = "0.15", path = "../dotenv_codegen_implementation" } -proc-macro-hack = "0.5" +dotenv_codegen_implementation = { path = "../dotenv_codegen_implementation" } +proc-macro-hack = "0.5.19" diff --git a/dotenv_codegen/src/lib.rs b/dotenv_codegen/src/lib.rs index c7588d4..459d344 100644 --- a/dotenv_codegen/src/lib.rs +++ b/dotenv_codegen/src/lib.rs @@ -1,3 +1,5 @@ +#![forbid(unsafe_code)] + use proc_macro_hack::proc_macro_hack; #[proc_macro_hack] diff --git a/dotenv_codegen_implementation/Cargo.toml b/dotenv_codegen_implementation/Cargo.toml index 23b719b..f61a949 100644 --- a/dotenv_codegen_implementation/Cargo.toml +++ b/dotenv_codegen_implementation/Cargo.toml @@ -18,11 +18,11 @@ license = "MIT" homepage = "https://github.com/dotenv-rs/dotenv" repository = "https://github.com/dotenv-rs/dotenv" description = "A `dotenv` implementation for Rust" -edition = "2018" +edition = "2021" [dependencies] -proc-macro2 = "1" -quote = "1" -syn = "1" -proc-macro-hack = "0.5" -dotenv = { version = "0.15", path = "../dotenv" } +proc-macro2 = "1.0.36" +quote = "1.0.14" +syn = "1.0.85" +proc-macro-hack = "0.5.19" +dotenv = { path = "../dotenv" } diff --git a/dotenv_codegen_implementation/src/lib.rs b/dotenv_codegen_implementation/src/lib.rs index 50a6cc2..0cee4d7 100644 --- a/dotenv_codegen_implementation/src/lib.rs +++ b/dotenv_codegen_implementation/src/lib.rs @@ -1,3 +1,5 @@ +#![forbid(unsafe_code)] + extern crate proc_macro; use std::env::{self, VarError};