diff --git a/Cargo.lock b/Cargo.lock index e8dc2fee52d5..5b6b19ac5f1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3337,7 +3337,6 @@ name = "forge-doc" version = "0.2.0" dependencies = [ "alloy-primitives", - "auto_impl", "derive_more 1.0.0", "eyre", "forge-fmt", diff --git a/crates/doc/Cargo.toml b/crates/doc/Cargo.toml index 0dcd407476c0..3ebc7f8dac62 100644 --- a/crates/doc/Cargo.toml +++ b/crates/doc/Cargo.toml @@ -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 diff --git a/crates/doc/src/writer/as_doc.rs b/crates/doc/src/writer/as_doc.rs index a21a59c1111c..a14f9d344471 100644 --- a/crates/doc/src/writer/as_doc.rs +++ b/crates/doc/src/writer/as_doc.rs @@ -14,7 +14,6 @@ use std::path::{Path, PathBuf}; pub type AsDocResult = Result; /// 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; @@ -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 @@ -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)?; diff --git a/crates/doc/src/writer/buf_writer.rs b/crates/doc/src/writer/buf_writer.rs index dfec68fe25ce..e6109c338c03 100644 --- a/crates/doc/src/writer/buf_writer.rs +++ b/crates/doc/src/writer/buf_writer.rs @@ -43,7 +43,7 @@ impl BufWriter { } /// Write [AsDoc] implementation to the buffer with newline. - pub fn writeln_doc(&mut self, doc: T) -> fmt::Result { + pub fn writeln_doc(&mut self, doc: &T) -> fmt::Result { writeln!(self.buf, "{}", doc.as_doc()?) }