leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
15.31k stars 599 forks source link

Clippy warnings in some components with rust 1.78 #2571

Closed abusch closed 2 months ago

abusch commented 2 months ago

Describe the bug There's a new clippy warning that shipped with Rust 1.78 and is turned on by default, which warns about empty rustdoc comments. See https://rust-lang.github.io/rust-clippy/master/index.html#/empty_docs.

It appears that the #[component] macro generates such empty rustdoc comments in the case where you don't specify your own rustdoc comment and the component has no properties, which now triggers the new clippy lint.

It's more of an annoyance than a bug as you can silence the warning by either adding a rustdoc to your component (probably good practice anyway...) or disabling the lint, but the component macro can probably be fixed to not output any empty rustdoc comment in that particular case.

Leptos Dependencies

leptos = { workspace = true, features = ["csr"] }
leptos-use = "0.10"
leptos_query = { version = "0.5", features = ["csr"] }
leptos_query_devtools = { version = "0.1", features = ["csr"] }
leptos_router = { version = "0.6", features = ["csr"] }

To Reproduce Steps to reproduce the behavior:

Expected behavior There shouldn't be any clippy::empty_docs warning.

redforks commented 2 months ago

Disable clippy::empty_docs in Cargo.toml:

[lints.clippy]
empty_docs = "allow"