Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Optional env #22

Merged
merged 4 commits into from
Apr 15, 2021
Merged

Optional env #22

merged 4 commits into from
Apr 15, 2021

Conversation

pleshevskiy
Copy link
Owner

Add possibility to get optional env

itconfig::config! {
     SOMETHING: Option<&'static str>,
     NOTHING: Option<&'static str>,
}

fn main() {
    std::env::set_var("SOMETHING", "hello world");
    assert_eq!(config::SOMETHING(), Some("hello world"));
    assert_eq!(config::NOTHING(), None);
}

small internal changes:

  • Move helper functions to utils
  • Deny all clippy rules

@pleshevskiy pleshevskiy mentioned this pull request Apr 15, 2021
@pleshevskiy pleshevskiy merged commit e398fec into main Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant