From de665c49ee5cb9b2bd8a12af091775789d759f08 Mon Sep 17 00:00:00 2001 From: Shafkath Shuhan Date: Mon, 30 Jan 2023 17:26:01 -0500 Subject: [PATCH] wip --- helix-core/src/path.rs | 2 +- helix-term/tests/test/commands.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/helix-core/src/path.rs b/helix-core/src/path.rs index b3d6519036991..471d0607df103 100644 --- a/helix-core/src/path.rs +++ b/helix-core/src/path.rs @@ -157,7 +157,7 @@ pub fn path_as_bytes>(path: P) -> Vec { pub fn path_from_bytes(slice: &[u8]) -> Result { #[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( diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs index 02b731e88b258..62dfe465e3749 100644 --- a/helix-term/tests/test/commands.rs +++ b/helix-term/tests/test/commands.rs @@ -367,10 +367,7 @@ async fn test_workspace_serde() -> anyhow::Result<()> { Some("ihello:sw:bc!:ow"), 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, )