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

Make create_apk_elf_path() infallible #1033

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented Feb 27, 2025

It doesn't really make much sense for the create_apk_elf_path() helper to be fallible. Conceptually at least, the algorithm is super straight forward and there is no reason to report an error just because no APK path is present. Yes, it's a logical error of sorts, but it's a logical error everywhere else as well, not just in this function. Adjust the logic to be a bit more robust (or at least easier to grasp) and to not emit any errors.

Bump the minimum supported Rust version to 1.70. Switching to this
version will allow us to use PathBuf::as_mut_os_string().

Signed-off-by: Daniel Müller <[email protected]>
It doesn't really make much sense for the create_apk_elf_path() helper
to be fallible. Conceptually at least, the algorithm is super straight
forward and there is no reason to report an error just because no APK
path is present. Yes, it's a logical error of sorts, but it's a logical
error everywhere else as well, not just in this function.
Adjust the logic to be a bit more robust (or at least easier to grasp)
and to not emit any errors.

Signed-off-by: Daniel Müller <[email protected]>
@d-e-s-o d-e-s-o force-pushed the topic/apk-path-rework branch from 33865ac to 5388db9 Compare February 27, 2025 00:18
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

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

Project coverage is 94.95%. Comparing base (8391c2d) to head (5388db9).

Files with missing lines Patch % Lines
src/apk.rs 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1033      +/-   ##
==========================================
- Coverage   94.96%   94.95%   -0.01%     
==========================================
  Files          60       60              
  Lines       10942    10948       +6     
==========================================
+ Hits        10391    10396       +5     
- Misses        551      552       +1     

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

@d-e-s-o d-e-s-o force-pushed the topic/apk-path-rework branch from 5388db9 to 8f6a274 Compare February 27, 2025 00:25
@d-e-s-o d-e-s-o merged commit eb98810 into libbpf:main Feb 27, 2025
42 checks passed
@d-e-s-o d-e-s-o deleted the topic/apk-path-rework branch February 27, 2025 00:31
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.

1 participant