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

wrappers: parse_*: file_name uses same bound as miette #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spikespaz
Copy link

@spikespaz spikespaz commented Dec 29, 2024

The three parse functions, parse_ast, parse, and parse_with_context take file_name as the first argument. This argument is used to construct miette::NamedSource, the new constructor of which takes AsRef<str>. This change ensures that miette's choice bound is preserved.

Unfortunately, miette misuses the bound, and clones (to String) in library code which is unidiomatic. Perhaps miette does not need to clone, and they knew this when writing the function signature? Does a new version of miette address this?

The three parse functions, `parse_ast`, `parse`, and
`parse_with_context` take `file_name` as the first argument.
This argument is used to construct `miette::NamedSource`,
the `new` constructor of which takes `AsRef<str>`.
This change ensures that `miette`'s choice bound is preserved.

Unfortunately, `miette` misuses the bound, and clones (to `String`)
in library code which is unidiomatic. Perhaps `miette` does not need to
clone, and they knew this when writing the function signature? Does a
new version of `miette` address this?
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.30%. Comparing base (163f329) to head (a92acec).

Files with missing lines Patch % Lines
src/wrappers.rs 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   76.26%   76.30%   +0.03%     
==========================================
  Files          15       15              
  Lines        4272     4279       +7     
  Branches     4272     4279       +7     
==========================================
+ Hits         3258     3265       +7     
  Misses        872      872              
  Partials      142      142              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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