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

replace bunch of get(x).is_some() by contains(x) #26

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

tardyp
Copy link
Contributor

@tardyp tardyp commented Nov 15, 2023

was doing some cleanup algorithms on my a2l files, and found out that there is more or less same algorithm already in the public a2lfile api, but implemented with get(x).is_some()

It is actually implemented the same at low level, but this is a arguably more idiomatic

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b5e0fd9) 85.60% compared to head (b922ad1) 85.60%.

Files Patch % Lines
src/cleanup/functions.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #26   +/-   ##
=======================================
  Coverage   85.60%   85.60%           
=======================================
  Files          27       27           
  Lines       10193    10193           
=======================================
  Hits         8726     8726           
  Misses       1467     1467           

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

@@ -70,7 +70,7 @@ fn generate_block_writer_generic(typename: &str, structitems: &[DataItem]) -> To

quote! {
impl #typeident {
pub(crate) fn stringify(&self, indent: usize) -> String {
pub fn stringify(&self, indent: usize) -> String {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the stringify function is useful to you, then it could definitely be made public.
That should be a separate commit though, not part of the cleanup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oups! this is some debug leftovers. sorry!

@DanielT
Copy link
Owner

DanielT commented Nov 15, 2023

Aside fom the stringify change this is a nice cleanup. If you push an update, I will merge the change.

@DanielT DanielT merged commit dcf3167 into DanielT:main Nov 15, 2023
4 checks passed
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