From: Jacob Casper Date: Sat, 25 Apr 2020 01:59:40 +0000 (-0500) Subject: Return error for env vars instead of panic X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=41621f4730084a148f21f1d70be12a7c9c960bbd;p=sockgit.git Return error for env vars instead of panic --- diff --git a/src/main.rs b/src/main.rs index a783233..bc758e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,9 +33,9 @@ fn main() -> Result<(), Box> { let repo = git2::Repository::init_opts(format!("{}.git", repo_name), &opts)?; - let public_user = env::var("USER").unwrap(); - let public_name = env::var("PUBLIC").unwrap(); - let public_path = env::var("PATH").unwrap(); + let public_user = env::var("USER")?; + let public_name = env::var("PUBLIC")?; + let public_path = env::var("PATH")?; repo.remote( &public_name, &format!(