Skip to content

Commit 581dc75

Browse files
committed
rustdoc: Remove a single-use macro
I think the new code is simpler and easier to understand.
1 parent 7865a85 commit 581dc75

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/librustdoc/docfs.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ use std::path::{Path, PathBuf};
1515
use std::string::ToString;
1616
use std::sync::mpsc::Sender;
1717

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-
2718
crate trait PathError {
2819
fn new<S, P: AsRef<Path>>(e: S, path: P) -> Self
2920
where
@@ -75,7 +66,7 @@ impl DocFS {
7566
});
7667
});
7768
} else {
78-
try_err!(fs::write(&path, contents), path);
69+
fs::write(&path, contents).map_err(|e| E::new(e, path))?;
7970
}
8071
Ok(())
8172
}

0 commit comments

Comments
 (0)