ammonia
ammonia copied to clipboard
Fix clippy warnings
This PR avoids fixing one clippy warning, since it's actually a breaking change.
error: type `Document` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`
--> src/lib.rs:2670:5
|
2670 | / pub fn to_string(&self) -> String {
2671 | | let opts = Self::serialize_opts();
2672 | | let mut ret_val = Vec::new();
2673 | | let inner: SerializableHandle = self.0.document.children.borrow()[0].clone().into();
... |
2676 | | String::from_utf8(ret_val).expect("html5ever only supports UTF8")
2677 | | }
| |_____^
|
= note: `#[deny(clippy::inherent_to_string_shadow_display)]` on by default
= help: remove the inherent method from type `Document`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string_shadow_display
This one will be fixed in version 4.
it's actually a breaking change
Can we move that code to impl Display? Or is it still a breaking change for users of Document::to_string without importing the trait?
I'm worried about people calling doc.to_string() without importing the ToString trait.
bors r+