Added /blog/edit, inline documentation
This commit is contained in:
parent
a90ca863e7
commit
6e72cba14c
4 changed files with 52 additions and 7 deletions
|
@ -1,5 +1,8 @@
|
|||
use std::string::String;
|
||||
|
||||
/// gets a value from an environment variable and returns it.
|
||||
/// if this call was mandatory and it couldn't get a value, it will exit
|
||||
/// the program and write an error message.
|
||||
pub fn get_from_env(variable: &str, mandatory: bool) -> String {
|
||||
std::env::var(variable).unwrap_or_else(|_| {
|
||||
if mandatory {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue