dfinity / dfinity/candid

CandidType derived on Enums gives an unused variable warning

Open
#468 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
301
Forks
85
Avg merge
1h 4m
Merged PRs (30d)
4

Description

I'm getting Rust warnings from the CandidType derive macro, only on enums and records with no fields.

Not a huge issue but there's a lot of yellow squiggles all over my VSCode.

image

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the warning with the CandidType derive macro on an enum and a record with no fields, using the issue's VSCode symptom as the check. Inspect the derive-macro handling for these empty types and confirm that the completed change no longer emits an unused-variable warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.