Skip to content

Commit

Permalink
rustdoc: Remove a single-use macro
Browse files Browse the repository at this point in the history
I think the new code is simpler and easier to understand.
  • Loading branch information
camelid committed Oct 29, 2021
1 parent 7865a85 commit 581dc75
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/librustdoc/docfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ use std::path::{Path, PathBuf};
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
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit 581dc75

Please sign in to comment.