Skip to content

fix(rust-guard): remove redundant match arm in author_association_floor_from_str#3654

Merged
lpcox merged 2 commits intomainfrom
copilot/rust-guard-remove-redundant-arms
Apr 12, 2026
Merged

fix(rust-guard): remove redundant match arm in author_association_floor_from_str#3654
lpcox merged 2 commits intomainfrom
copilot/rust-guard-remove-redundant-arms

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Two match arms in author_association_floor_from_str both returned vec![], making "FIRST_TIMER" | "NONE" dead code — fully subsumed by the wildcard below it.

Changes

  • guards/github-guard/rust-guard/src/labels/helpers.rs: Drop the "FIRST_TIMER" | "NONE" arm; fold into the wildcard with a clarifying comment.
// Before
"FIRST_TIMER" | "NONE" => vec![],
_ => vec![],

// After
_ => vec![], // FIRST_TIMER, NONE, or any unrecognised value

No behaviour change. The lib.rs duplicate integrity-branch issue noted in the report was already resolved in the codebase.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build4291131586/b514/launcher.test /tmp/go-build4291131586/b514/launcher.test -test.testlogfile=/tmp/go-build4291131586/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s E=3 .cfg /tmp/go-build406-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet .cfg�� /yaml.v3@v3.0.1/apic.go /yaml.v3@v3.0.1/decode.go x_amd64/vet ute.go mentation.go -o x_amd64/vet (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build4291131586/b496/config.test /tmp/go-build4291131586/b496/config.test -test.testlogfile=/tmp/go-build4291131586/b496/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4291131586/b338/vet.cfg oding@v0.5.4/iso8601/parse.go oding@v0.5.4/iso8601/valid.go x_amd64/vet --gdwarf-5 nal/protolazy -o x_amd64/vet 4459�� g_.a ache/go/1.25.8/x64/src/log/log.go x_amd64/vet --gdwarf-5 4459165/b239/ -o x_amd64/vet (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build4291131586/b514/launcher.test /tmp/go-build4291131586/b514/launcher.test -test.testlogfile=/tmp/go-build4291131586/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s E=3 .cfg /tmp/go-build406-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet .cfg�� /yaml.v3@v3.0.1/apic.go /yaml.v3@v3.0.1/decode.go x_amd64/vet ute.go mentation.go -o x_amd64/vet (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build4291131586/b514/launcher.test /tmp/go-build4291131586/b514/launcher.test -test.testlogfile=/tmp/go-build4291131586/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s E=3 .cfg /tmp/go-build406-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet .cfg�� /yaml.v3@v3.0.1/apic.go /yaml.v3@v3.0.1/decode.go x_amd64/vet ute.go mentation.go -o x_amd64/vet (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build4291131586/b523/mcp.test /tmp/go-build4291131586/b523/mcp.test -test.testlogfile=/tmp/go-build4291131586/b523/testlog.txt -test.paniconexit0 -test.timeout=10m0s .cfg�� 4459165/b389/_pk-p -I x_amd64/vet --gdwarf-5 g/grpc/internal//usr/bin/runc -o x_amd64/vet .cfg�� lhk-/9CAufbOhYsrgo1.25.8 /tmp/go-build406-c=4 x_amd64/vet . _value"]."\n"; --64 x_amd64/vet (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix redundant match arms in author_association_floor_from_str fix(rust-guard): remove redundant match arm in author_association_floor_from_str Apr 12, 2026
Copilot AI requested a review from lpcox April 12, 2026 16:12
@lpcox lpcox marked this pull request as ready for review April 12, 2026 16:15
Copilot AI review requested due to automatic review settings April 12, 2026 16:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the Rust GitHub guard’s author_association_floor_from_str helper by removing a redundant match arm that returned the same value as the wildcard case, without changing behavior.

Changes:

  • Removed the redundant "FIRST_TIMER" | "NONE" match arm that was fully subsumed by the wildcard arm.
  • Added an inline comment clarifying that the wildcard also covers FIRST_TIMER, NONE, and any unknown values.
Show a summary per file
File Description
guards/github-guard/rust-guard/src/labels/helpers.rs Simplifies author_association_floor_from_str match logic by removing a redundant arm and clarifying fallback behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@lpcox lpcox merged commit 526790c into main Apr 12, 2026
32 checks passed
@lpcox lpcox deleted the copilot/rust-guard-remove-redundant-arms branch April 12, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rust-guard] Rust Guard: Redundant match arms & duplicate integrity-branch logic

3 participants