Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove utf_encode method #4668

Merged
merged 1 commit into from
Mar 5, 2025
Merged

Remove utf_encode method #4668

merged 1 commit into from
Mar 5, 2025

Conversation

KludgeKML
Copy link
Contributor

  • defining a method inside a partial like this causes the method to be potentially defined multiple times, and causes covered to complain when running test suites in apps that use the gem.
  • ...and in fact the method isn't really needed. It's checking if the thing to be encoded is a string, but it's being called only twice, with the output of a gsub (which by definition returns a string). So it'll always be a string, and always can just be passed to #encode.

- defining a method inside a partial like this causes the
  method to be potentially defined multiple times, and
  causes `covered` to complain when running test suites
  in apps that use the gem.
- ...and in fact the method isn't really needed. It's checking
  if the thing to be encoded is a string, but it's being called
  only twice, with the output of a gsub (which by definition
  returns a string). So it'll always be a string, and always
  can just be passed to #encode.
@KludgeKML KludgeKML requested review from andysellick and AshGDS March 5, 2025 10:16
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4668 March 5, 2025 10:16 Inactive
@KludgeKML KludgeKML merged commit 222cb59 into main Mar 5, 2025
12 checks passed
@KludgeKML KludgeKML deleted the simplify-utf-encode-feedback branch March 5, 2025 15:09
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.

3 participants