Skip to content

Commit

Permalink
Use option_env! instead of env!
Browse files Browse the repository at this point in the history
  • Loading branch information
slvrtrn committed Aug 25, 2024
1 parent c4acbb9 commit 85f2b27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use hyper::http::request::Builder;
use std::collections::HashMap;

// See https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates
const PKG_VER: &str = env!("CARGO_PKG_VERSION", "unknown");
const RUST_VER: &str = env!("CARGO_PKG_RUST_VERSION", "unknown");
const PKG_VER: &str = option_env!("CARGO_PKG_VERSION").unwrap_or("unknown");
const RUST_VER: &str = option_env!("CARGO_PKG_RUST_VERSION").unwrap_or("unknown");
const OS: &str = std::env::consts::OS;

fn get_user_agent(products_info: &[ProductInfo]) -> String {
Expand Down

0 comments on commit 85f2b27

Please sign in to comment.