Skip to content

Commit 956aefe

Browse files
author
Andrew
committed
Clippy fix
1 parent 4ca98bf commit 956aefe

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

dsc_lib/src/util.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,19 @@ fn load_value_from_json(path: &PathBuf, value_name: &str) -> Result<serde_json::
142142
Err(DscError::NotSupported(value_name.to_string()))
143143
}
144144

145+
/// Gets path to the current dsc process.
146+
/// If dsc is started using a symlink, this functon returns target of the symlink.
147+
///
148+
/// # Errors
149+
///
150+
/// Will return `Err` if path to the current exe can't be retrived.
145151
pub fn get_exe_path() -> Result<PathBuf, DscError> {
146152
if let Ok(exe) = env::current_exe() {
147153
if let Ok(target_path) = fs::read_link(exe.clone()) {
148154
return Ok(target_path);
149-
}
150-
else {
151-
return Ok(exe);
152-
}
155+
};
156+
157+
return Ok(exe);
153158
}
154159

155160
Err(DscError::NotSupported("Can't get the path to dsc executable".to_string()))

0 commit comments

Comments
 (0)