Skip to content

id: clippy-lint red on main — expect_used at src/tags.rs:1484,1499 (clippy 1.99) #2401

Closed

Description

@dezren39

Problem

The basic: nix flake check (clippy-lint) PR check fails on pkgs/id with two clippy::expect_used errors in code this repo has not changed:

error: used `expect()` on an `Option` value
   --> src/tags.rs:1484:22
    |
1484 |     let ch = input[i..].chars().next().expect("i is a char boundary");
     |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: requested on the command line with `-D clippy::expect-used`

error: used `expect()` on an `Option` value
   --> src/tags.rs:1499:22
    |
1499 |     let ch = input[i..].chars().next().expect("i is a char boundary");

Evidence it is pre-existing, not PR-local

Impact

Every PR touching pkgs/id is unmergeable: clippy-lint is a required check. #1820 is parked on this, and other app/id work will queue behind it.

Expected fix

Either replace the two expect() calls with a non-panicking form, e.g.

let Some(ch) = input[i..].chars().next() else { break };

(the enclosing loops already break when i >= input.len()), or, if the panic is genuinely intended as an invariant, #[allow(clippy::expect_used)] with a comment — but prefer the let-else, since i is always advanced by len_utf8.

Verify with the clippy-lint check (nix build .#checks.<system>.id-clippy-lint or cargo clippy -p id --all-targets -- -D clippy::expect-used), not just cargo check: the 366 warnings in the same log are non-fatal and must not be "fixed" here.

Related

Acceptance criteria

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  3. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 30, 2026
  4. dezren39 commented on Oct 30, 2026

    @dezren39
    MemberAuthor

    Intake review (fleet monitor, 2026-10-29 run):

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  6. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    Triage findings (queue task 3611, repo-worker-code lane bf419306, 2026-11-03):

    Already resolved — recommending close. Verified against fresh origin/main (d368b9fb):

    • Both offending lines (src/tags.rs:1484,1499, .expect("i is a char boundary") on chars().next()) are gone from main. The file now lives at pkgs/id/src/tags.rs and both sites use panic-free let Some(ch) = input[i..].chars().next() else { break; } with an invariant comment.
    • git grep -n '.expect(' origin/main -- pkgs/id/src/tags.rs returns zero matches — no .expect( call remains in the file, so -D clippy::expect-used cannot fire on it.
    • The fix arrived via PR id: rustfmt meta_client.rs + drop expect() in tags parser — unbreak main fmt/clippy (#2151) #2335 ("id: rustfmt meta_client.rs + drop expect() in tags parser", touched pkgs/id/src/tags.rs +9/-3), merged 2026-10-30 (merge commit 9c976b8).

    Caveat: could not confirm a green clippy-lint run on current main because the id workflow queue is backlogged (latest main runs all queued), and the old basic: nix flake check (clippy-lint) job name no longer exists under current workflow names. But the lint in question is deterministic on file content — with no .expect( left in the file, this exact failure cannot recur. If clippy flags anything else in pkgs/id, that would be a new issue, not this one.

    No follow-up fix packet needed. Closing with evidence per the triage acceptance criteria.

  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitive

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions