Remove unnecessary item_name parameter to mod_item_out

This commit is contained in:
Joshua Nelson 2021-04-22 19:46:53 -04:00
parent 423963c07b
commit 7f6d540440
3 changed files with 5 additions and 7 deletions

View file

@ -37,7 +37,9 @@ crate trait FormatRenderer<'tcx>: Sized {
fn mod_item_in(&mut self, item: &clean::Item, item_name: &str) -> Result<(), Error>;
/// Runs after recursively rendering all sub-items of a module.
fn mod_item_out(&mut self, item_name: &str) -> Result<(), Error>;
fn mod_item_out(&mut self) -> Result<(), Error> {
Ok(())
}
/// Post processing hook for cleanup and dumping output to files.
fn after_krate(&mut self) -> Result<(), Error>;
@ -87,7 +89,7 @@ crate fn run_format<'tcx, T: FormatRenderer<'tcx>>(
work.push((cx.make_child_renderer(), it));
}
cx.mod_item_out(&name)?;
cx.mod_item_out()?;
// FIXME: checking `item.name.is_some()` is very implicit and leads to lots of special
// cases. Use an explicit match instead.
} else if item.name.is_some() && !item.is_extern_crate() {

View file

@ -617,7 +617,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
Ok(())
}
fn mod_item_out(&mut self, _item_name: &str) -> Result<(), Error> {
fn mod_item_out(&mut self) -> Result<(), Error> {
info!("Recursed; leaving {}", self.dst.display());
// Go back to where we were at

View file

@ -198,10 +198,6 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
Ok(())
}
fn mod_item_out(&mut self, _item_name: &str) -> Result<(), Error> {
Ok(())
}
fn after_krate(&mut self) -> Result<(), Error> {
debug!("Done with crate");
let mut index = (*self.index).clone().into_inner();