We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7865a85 commit 581dc75Copy full SHA for 581dc75
src/librustdoc/docfs.rs
@@ -15,15 +15,6 @@ use std::path::{Path, PathBuf};
15
use std::string::ToString;
16
use std::sync::mpsc::Sender;
17
18
-macro_rules! try_err {
19
- ($e:expr, $file:expr) => {
20
- match $e {
21
- Ok(e) => e,
22
- Err(e) => return Err(E::new(e, $file)),
23
- }
24
- };
25
-}
26
-
27
crate trait PathError {
28
fn new<S, P: AsRef<Path>>(e: S, path: P) -> Self
29
where
@@ -75,7 +66,7 @@ impl DocFS {
75
66
});
76
67
77
68
} else {
78
- try_err!(fs::write(&path, contents), path);
69
+ fs::write(&path, contents).map_err(|e| E::new(e, path))?;
79
70
}
80
71
Ok(())
81
72
0 commit comments