]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/docfs.rs
Rollup merge of #90022 - hkmatsumoto:self-upper-as-generic-parameter, r=jackh726
[rust.git] / src / librustdoc / docfs.rs
index a5fab1b3d42170c7f7ccdd527dae9dca37820cf6..d59273db08b4f9f50fe7155816a55340893f3ed2 100644 (file)
 use std::string::ToString;
 use std::sync::mpsc::Sender;
 
-macro_rules! try_err {
-    ($e:expr, $file:expr) => {
-        match $e {
-            Ok(e) => e,
-            Err(e) => return Err(E::new(e, $file)),
-        }
-    };
-}
-
 crate trait PathError {
     fn new<S, P: AsRef<Path>>(e: S, path: P) -> Self
     where
@@ -75,7 +66,7 @@ impl DocFS {
                 });
             });
         } else {
-            try_err!(fs::write(&path, contents), path);
+            fs::write(&path, contents).map_err(|e| E::new(e, path))?;
         }
         Ok(())
     }