@@ -554,11 +554,9 @@ impl Document {
556 pub fn set_path(&mut self, path: Option<&Path>) -> Result<(), std::io::Error> {
556 pub fn set_path(&mut self, path: Option<&Path>) -> Result<(), std::io::Error> {
557− let path = if let Some(p) = path {
557+ let path = path
558− Some(helix_core::path::get_canonicalized_path(p)?)
558+ .map(|path| helix_core::path::get_canonicalized_path(path))
559− } else {
559+ .transpose()?;
560− path.map(|p| p.into())
563 // if parent doesn't exist we still want to open the document
561 // if parent doesn't exist we still want to open the document
564 // and error out when document is saved
562 // and error out when document is saved