Skip to content

refactor: pass around &str instead of &[u8]#20

Merged
kdkasad merged 1 commit intomasterfrom
refactor
Jun 27, 2025
Merged

refactor: pass around &str instead of &[u8]#20
kdkasad merged 1 commit intomasterfrom
refactor

Conversation

@kdkasad
Copy link
Owner

@kdkasad kdkasad commented Jun 27, 2025

Closes #10.

@kdkasad kdkasad self-assigned this Jun 27, 2025
@kdkasad kdkasad added the code cleanup Improvements to source code that don't change functionality label Jun 27, 2025
@github-actions
Copy link

Test Results

41 tests   41 ✅  0s ⏱️
 3 suites   0 💤
 1 files     0 ❌

Results for commit 72e2293.

@kdkasad kdkasad merged commit e3f12c5 into master Jun 27, 2025
17 checks passed
@kdkasad kdkasad requested a review from Copilot June 28, 2025 04:27
Copy link

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

Refactor to use &str instead of &[u8] for the code parameter across rules, helpers, tests, and the main application.

  • Updated Rule::check signatures and callsites to accept &str.
  • Removed redundant UTF-8 conversions, using direct slicing or .as_bytes() where needed.
  • Adjusted all test cases and helper functions to pass &str.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/rules/rule12a.rs Updated check signature and test helper invocation to &str.
src/rules/rule11e.rs Updated check signature to accept &str.
src/rules/rule11b.rs Removed UTF-8 conversion, updated signature, and tests.
src/rules/rule11a.rs Removed UTF-8 conversion, updated signature, and tests.
src/rules/rule03f.rs Changed check signature to accept &str.
src/rules/rule03e.rs Changed signature and removed UTF-8 conversion.
src/rules/rule03d.rs Signature changes, replaced UTF-8 conversions, updated slicing.
src/rules/rule03c.rs Signature change and updated byte comparisons.
src/rules/rule03b.rs Signature change and updated spacing helper.
src/rules/rule03a.rs Signature change and updated message formatting.
src/rules/rule02b.rs Signature change and test updates.
src/rules/rule02a.rs Signature change, removed UTF-8 conversions, updated helper.
src/rules/rule01d.rs Signature change and updated error message slicing.
src/rules/rule01c.rs Signature change, replaced utf8_text with slicing.
src/rules/rule01b.rs Signature change.
src/rules/rule01a.rs Signature change and slicing in suggestions.
src/rules/api.rs Updated Rule trait signature.
src/main.rs Updated invocation of rule.check to pass &code.
src/helpers/testing.rs Updated QueryHelper::new invocation to accept &str.
src/helpers/mod.rs Changed QueryHelper::new signature and code storage.

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

Labels

code cleanup Improvements to source code that don't change functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce UTF-8 conversions

2 participants