Closed Stay1444 closed 3 months ago
There are multiple Action
s in serenity, thus both cannot be in serenity::all
. Use the full path.
I'm using the full path!
error[E0599]: no variant or associated item named `GuildUpdate` found for enum `serenity::all::Action` in the current scope
--> src/event_handler.rs:43:40
|
43 | serenity::all::Action::GuildUpdate => (),
| ^^^^^^^^^^^ variant or associated item not found in `Action`
The LSP completes that fine, and going to the definition shows me the correct Action enum.
LSP's aren't perfect, cargo check
will always give you the right result. You need to use the full path of Action
, serenity::all::Action
is a reexport, not the full path.
The reexport points at serenity::model::guild::automod::Action
not serenity::model::guild::audit_log::Action
which you are intending to use here.
That was it, thank you.
I'm trying to handle the
FullEvent::GuildAuditLogEntryCreate
event, but when trying to match on theAuditLogEntry.action
member variable the LSP gives the available optionsBut it then throws an error saying that it can't find that enum entry.
Happens when running
cargo build
too.