Skip to content

Commit 3ca01f5

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
address clippy
1 parent 09f50c0 commit 3ca01f5

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

dsc_lib/src/discovery/command_discovery.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,19 @@ impl CommandDiscovery {
5757
let mut using_custom_path = false;
5858

5959
// try DSC_RESOURCE_PATH env var first otherwise use PATH
60-
let path_env = match env::var_os("DSC_RESOURCE_PATH") {
61-
Some(value) => {
62-
debug!("Using DSC_RESOURCE_PATH: {:?}", value.to_string_lossy());
63-
using_custom_path = true;
64-
value
65-
},
66-
None => {
67-
trace!("DSC_RESOURCE_PATH not set, trying PATH");
68-
match env::var_os("PATH") {
69-
Some(value) => {
70-
debug!("Using PATH: {:?}", value.to_string_lossy());
71-
value
72-
}
73-
None => {
74-
return Err(DscError::Operation("Failed to get PATH environment variable".to_string()));
75-
}
60+
let path_env = if let Some(value) = env::var_os("DSC_RESOURCE_PATH") {
61+
debug!("Using DSC_RESOURCE_PATH: {:?}", value.to_string_lossy());
62+
using_custom_path = true;
63+
value
64+
} else {
65+
trace!("DSC_RESOURCE_PATH not set, trying PATH");
66+
match env::var_os("PATH") {
67+
Some(value) => {
68+
debug!("Using PATH: {:?}", value.to_string_lossy());
69+
value
70+
},
71+
None => {
72+
return Err(DscError::Operation("Failed to get PATH environment variable".to_string()));
7673
}
7774
}
7875
};

0 commit comments

Comments
 (0)