Skip to content

Commit

Permalink
chore(doc): remove auto_impl (#8922)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Sep 21, 2024
1 parent ed3ed15 commit 0380ca7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/doc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ foundry-config.workspace = true

alloy-primitives.workspace = true

auto_impl.workspace = true
derive_more.workspace = true
eyre.workspace = true
itertools.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions crates/doc/src/writer/as_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::path::{Path, PathBuf};
pub type AsDocResult = Result<String, std::fmt::Error>;

/// A trait for formatting a parse unit as documentation.
#[auto_impl::auto_impl(&)]
pub trait AsDoc {
/// Formats a parse tree item into a doc string.
fn as_doc(&self) -> AsDocResult;
Expand Down Expand Up @@ -224,7 +223,7 @@ impl AsDoc for Document {
// TODO: cleanup
// Write function docs
writer.writeln_doc(
item.comments.exclude_tags(&[CommentTag::Param, CommentTag::Return]),
&item.comments.exclude_tags(&[CommentTag::Param, CommentTag::Return]),
)?;

// Write function header
Expand Down Expand Up @@ -295,7 +294,7 @@ impl Document {
writer.writeln()?;

// Write function docs
writer.writeln_doc(comments.exclude_tags(&[CommentTag::Param, CommentTag::Return]))?;
writer.writeln_doc(&comments.exclude_tags(&[CommentTag::Param, CommentTag::Return]))?;

// Write function header
writer.write_code(code)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/doc/src/writer/buf_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl BufWriter {
}

/// Write [AsDoc] implementation to the buffer with newline.
pub fn writeln_doc<T: AsDoc>(&mut self, doc: T) -> fmt::Result {
pub fn writeln_doc<T: AsDoc>(&mut self, doc: &T) -> fmt::Result {
writeln!(self.buf, "{}", doc.as_doc()?)
}

Expand Down

0 comments on commit 0380ca7

Please sign in to comment.