Skip to content

Commit

Permalink
Fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
michidk authored Oct 20, 2024
1 parent f781f19 commit a024687
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,19 @@ pub fn convert(
#[cfg(windows)]
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW

let output = cmd.output().map_err(|e| format!("Error executing wsl.exe: {}", e))?;
let output = cmd
.output()
.map_err(|e| format!("Error executing wsl.exe: {}", e))?;

let code = output.status.code().unwrap_or(-1);
if code != 0 {
return Err(format!("Error getting wslpath: {}", code).into());
}

Ok(std::str::from_utf8(&output.stdout).map_err(|e| format!("Error converting output to string: {}", e))?.trim().to_string())
Ok(std::str::from_utf8(&output.stdout)
.map_err(|e| format!("Error converting output to string: {}", e))?
.trim()
.to_string())
}

#[cfg(test)]
Expand Down

0 comments on commit a024687

Please sign in to comment.