You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clippy emits warnings about unused imports, even though they are in fact used and required for a successful build. This happens when the code using the import is inside a Dioxus server function.
Steps To Reproduce
Steps to reproduce the behavior:
Run
dx new dioxus-unused-import
bare-bones
fullstack: true
router: true
Tailwind CSS: true
platform: web
Run
cargo add dotenvy
Import dotenvy::dotenv and use it inside a Dioxus server function (the auto-generated one in this case):
use dotenvy::dotenv;#[server(EchoServer)]asyncfnecho_server(input:String) -> Result<String,ServerFnError>{let _ = dotenv();Ok(input)}
Run
cargo clippy
Observe the warning:
warning: unused import: `dotenvy::dotenv`
--> src/main.rs:2:5
|
2 | use dotenvy::dotenv;
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
I've done this in a reproduction repo. The warnings get emited for many more imports than just dotenv, e.g. in this repo.
Removing #[server(EchoServer)] fixes the warning, but of course breaks the functionality. This may be a Clippy issue – I don't have the insight into the macro to judge.
Expected behavior
The warning should not be emited, as the import is used.
Environment:
Dioxus version: 0.6.1
Rust version: 1.83.0
OS info: Docker rust:1.83-bookworm image
App platform: web
The text was updated successfully, but these errors were encountered:
Problem
Clippy emits warnings about unused imports, even though they are in fact used and required for a successful build. This happens when the code using the import is inside a Dioxus server function.
Steps To Reproduce
Steps to reproduce the behavior:
dotenvy::dotenv
and use it inside a Dioxus server function (the auto-generated one in this case):I've done this in a reproduction repo. The warnings get emited for many more imports than just
dotenv
, e.g. in this repo.Removing
#[server(EchoServer)]
fixes the warning, but of course breaks the functionality. This may be a Clippy issue – I don't have the insight into the macro to judge.Expected behavior
The warning should not be emited, as the import is used.
Environment:
rust:1.83-bookworm
imageThe text was updated successfully, but these errors were encountered: