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

Fix panic caused by unwrap #285

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

cardigan1008
Copy link
Contributor

Fix 8.Unwrap error in #244

In the replay file, from_format_str takes "%" as format_str, thus causing the format returned by from_str empty.

let mut cur_item = self.items[cur_item_idx].unwrap();

This results in the items in parse being empty, which causes an unwrap error. In my opinion, it should be classified as an UnknownFormat error since it's related to format.

The format parsed in from_str maybe empty(eg. '%'). As a result,
cur_item may be None.
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 81.66%. Comparing base (822c0a0) to head (b8e3a17).

Files Patch % Lines
src/efmt/format.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #285      +/-   ##
==========================================
- Coverage   81.67%   81.66%   -0.02%     
==========================================
  Files          16       16              
  Lines        3836     3839       +3     
==========================================
+ Hits         3133     3135       +2     
- Misses        703      704       +1     

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

@ChristopherRabotin ChristopherRabotin merged commit c28151d into nyx-space:master Apr 6, 2024
16 of 31 checks passed
@ChristopherRabotin
Copy link
Member

Thanks for your contributions, Yunbo, I finally fixed the CI pipelines, so I've merged all of your outstanding PRs.

@cardigan1008
Copy link
Contributor Author

Thanks for your contributions, Yunbo, I finally fixed the CI pipelines, so I've merged all of your outstanding PRs.

Thanks for your reviews too! They're a lot of help to the panic repair tool I've been working on.

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