MudEngine Part 5: Polished UI with dioxus-components
Lint your code with Clippy
Clippy is Rust's built-in linter — it catches common mistakes before they ship. Part 1 installed it; now run it against the polished UI app. Our goal: zero warnings.
A lint you will likely trip over here is clippy::clone_on_copy: Direction and Signal are Copy, so calling .clone() on them is redundant. The code above already applies that lesson — WorldGrid copies dir2 straight from exit_dir and hands world into the click closure by value instead of cloning.
Note the lint task we defined in mise.toml runs plain cargo clippy and expects a clean result — no -D warnings flag needed when the code is already clean.
cargo clippyA clippy-clean run shows no warning: lines and just finishes:
$ cargo clippy
Checking mud-engine v0.1.0 (/home/<you>/dev/mud-engine/mud-engine)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.88s
If you see warnings, fix them — a .clone() on a Copy type is usually a redundant clone that can be dropped.