diff options
author | Canop <cano.petrole@gmail.com> | 2020-12-11 13:12:05 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-12-11 13:12:05 +0100 |
commit | aab4f13284e2b61e485aeb898b84e2332c968227 (patch) | |
tree | ec5b936355017bf05f70ce9cf6fe75f5e2e239e6 /src/launchable.rs | |
parent | f6efb7456752ac0fcd603d5c2afbb9a0118f630c (diff) |
use serde's derive to deserialize conf
Diffstat (limited to 'src/launchable.rs')
-rw-r--r-- | src/launchable.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/launchable.rs b/src/launchable.rs index 0d1ccb2..8794d82 100644 --- a/src/launchable.rs +++ b/src/launchable.rs @@ -64,8 +64,8 @@ pub enum Launchable { fn resolve_env_variables(parts: Vec<String>) -> Vec<String> { let mut resolved = Vec::new(); for part in parts.into_iter() { - if part.starts_with('$') { - if let Ok(val) = env::var(&part[1..]) { + if let Some(var_name) = part.strip_prefix('$') { + if let Ok(val) = env::var(var_name) { resolved.extend(val.split(' ').map(|s| s.to_string())); continue; } |