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

kargs: A few more minor cleanups and test improvements #648

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

cgwalters
Copy link
Collaborator

No description provided.

Just reducing the size of the main `get_kargs`.

Now that we've split out the helper, add a unit test.

Signed-off-by: Colin Walters <walters@verbum.org>
Instead of nested `if`, use `continue` to de-indent.

Signed-off-by: Colin Walters <walters@verbum.org>
Signed-off-by: Colin Walters <walters@verbum.org>
Since we have two different read paths.

Signed-off-by: Colin Walters <walters@verbum.org>
parse_kargs_toml(&s, sys_arch).with_context(|| format!("Parsing {name}"))?;
ret.extend(parsed_kargs);
}
let name = if let Some(name) = name.to_str() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm totally fine with this change, but I guess I just personally don't like having else statements only containing continue even if it helps with code readability. Once again, okay with this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's somewhat idiomatic I think in Rust at least.

Although...actually for a while now there's been let-else which I think we can do a tree-wide conversion to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

➡️ #650

Copy link
Contributor

@lukewarmtemp lukewarmtemp left a comment

Choose a reason for hiding this comment

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

LGTM

@cgwalters cgwalters merged commit 72f9013 into containers:main Jun 28, 2024
14 of 19 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.

None yet

2 participants