tor-config: paths, unexpanded: use infallible conversion
str can always be made into a PathBuf.
This commit is contained in:
parent
4d2140641d
commit
42ad8d99aa
|
@ -165,8 +165,7 @@ fn expand(s: &str) -> Result<PathBuf, CfgPathError> {
|
|||
/// Helper: convert a string to a path without expansion.
|
||||
#[cfg(not(feature = "expand-paths"))]
|
||||
fn expand(s: &str) -> Result<PathBuf, CfgPathError> {
|
||||
s.try_into()
|
||||
.map_err(|_| CfgPathError::InvalidString(s.to_owned()))
|
||||
s.into()
|
||||
}
|
||||
|
||||
/// Shellexpand helper: return the user's home directory if we can.
|
||||
|
|
Loading…
Reference in New Issue