Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kirawi committed Jan 30, 2023
1 parent 50d8bf1 commit de665c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helix-core/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub fn path_as_bytes<P: AsRef<Path>>(path: P) -> Vec<u8> {

pub fn path_from_bytes(slice: &[u8]) -> Result<PathBuf, Utf8Error> {
#[cfg(windows)]
return Ok(PathBuf::from(std::str::from_utf8(slice)));
return Ok(PathBuf::from(std::str::from_utf8(slice)?));

#[cfg(unix)]
return Ok(PathBuf::from(
Expand Down
5 changes: 1 addition & 4 deletions helix-term/tests/test/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,7 @@ async fn test_workspace_serde() -> anyhow::Result<()> {
Some("ihello<esc>:sw<ret>:bc!<ret>:ow<ret>"),
Some(&|app| {
let mut docs: Vec<_> = app.editor.documents().collect();
assert_eq!(1, docs.len());

let doc = docs.pop().unwrap();
assert_eq!(Some(file.path()), doc.path().map(PathBuf::as_path));
assert_eq!(2, docs.len());
}),
false,
)
Expand Down

0 comments on commit de665c4

Please sign in to comment.