master does not compile: ContinuousEvent::Caption matched as tuple, declared as struct

Open Beginner friendly
#2,225 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Read the ContinuousEvent::Caption declaration in crates/jcode-voice/src/continuous.rs:57 and the match in crates/jcode-tui/src/tui/app/jarvis_listen.rs:383. Start by comparing the variant’s fields with the match pattern; update the two sites so they agree, then run cargo build -p jcode --bin jcode. Done when that build succeeds.

Written by the indexing model from the issue text.

Description

Summary

origin/master at fb21cb403 does not compile:

error[E0164]: expected tuple struct or tuple variant, found struct variant `ContinuousEvent::Caption`
   --> crates/jcode-tui/src/tui/app/jarvis_listen.rs:383:21
    |
383 |                     ContinuousEvent::Caption(text) => {

Why

The variant is declared as a struct variant in crates/jcode-voice/src/continuous.rs:57:

Caption {
    ...
}

but matched as a tuple variant in crates/jcode-tui/src/tui/app/jarvis_listen.rs:383:

ContinuousEvent::Caption(text) => {

Evidence

  • git diff origin/master -- crates/jcode-tui/src/tui/app/jarvis_listen.rs is empty on a branch rebased onto fb21cb403, so the file is exactly master's.
  • cargo build -p jcode --bin jcode on that tree stops at the error above.
  • Nothing in the reporting branch touches jarvis_listen.rs, continuous.rs, or Jarvis code at all.

Impact

Every PR that merges into master inherits this, so the build jobs go red for reasons unrelated to the PR. It also blocks local verification of any Windows/ConPTY work, because the binary cannot be produced.

Fix

Either destructure the struct variant at jarvis_listen.rs:383 (ContinuousEvent::Caption { text, .. } or whatever the fields are), or change the declaration if the tuple form was intended. Whichever it is, the two sites have to agree; I did not touch it because it is outside the scope of the branch that found it.

Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
1d 8h
Merged PRs (30d)
1

Getting set up

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.

More from 1jehuang/jcode

All issues in 1jehuang/jcode

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.