Skip to content

Resolve Clippy manual-pattern-char-comparison in JSONPath segment parsing - #55

Draft
dogenkigen with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-linter-issue
Draft

Resolve Clippy manual-pattern-char-comparison in JSONPath segment parsing#55
dogenkigen with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-linter-issue

Conversation

Copilot AI commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

CI was failing in the lint stage due to -D warnings enforcing clippy::manual-pattern-char-comparison in JSONPath parsing (src/json_diff/path.rs). The parser used a manual closure for delimiter matching where Clippy expects a char-pattern split.

  • Problem summary

    • Clippy flagged manual char comparison in the JSONPath tokenizer (.split(|c| c == '.' || c == '[')), causing compilation to fail under strict lint settings.
  • Code change

    • Updated JSONPath segment splitting to use idiomatic multi-char pattern matching:
      • from manual predicate closure
      • to array-based delimiter pattern
  • Scope

    • Single-line change in Path::from_jsonpath with no behavioral expansion; parsing semantics remain aligned with existing path tokenization logic.
// before
.split(|c| c == '.' || c == '[')

// after
.split(['.', '['])

馃敀 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: dogenkigen <2345634+dogenkigen@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix linter issue with manual char comparison Resolve Clippy manual-pattern-char-comparison in JSONPath segment parsing Mar 6, 2026
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.

2 participants