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

install: Some cleanups around root_path #905

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

cgwalters
Copy link
Collaborator

The extra cloning we were doing here looked odd to me. I think this ends up being cleaner make the toplevel variable mutable and replace it only in the circumstance we detect an ostree deployment.

@github-actions github-actions bot added the area/install Issues related to `bootc install` label Nov 18, 2024
@cgwalters cgwalters requested a review from omertuc November 18, 2024 22:19
Copy link
Contributor

@omertuc omertuc left a comment

Choose a reason for hiding this comment

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

Looks good

lib/src/install.rs Outdated Show resolved Hide resolved
@omertuc
Copy link
Contributor

omertuc commented Nov 19, 2024

The extra cloning we were doing here looked odd to me. I think this ends up being cleaner make the toplevel variable mutable and replace it only in the circumstance we detect an ostree deployment.

I personally find mutations harder to follow as a code reader/debugger, even if they're sometimes "simpler" (mostly in terms of LoC) and more performant, but it's all very subjective

@omertuc omertuc mentioned this pull request Nov 19, 2024
lib/src/install.rs Outdated Show resolved Hide resolved
@cgwalters cgwalters force-pushed the minor-install-root-path branch from e8f5fd1 to 0927a05 Compare November 19, 2024 13:31
The extra cloning we were doing here looked odd to me. I think
this ends up being cleaner make the toplevel variable mutable
and replace it only in the circumstance we detect an ostree
deployment.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the minor-install-root-path branch from 0927a05 to 784b31c Compare November 19, 2024 13:36
@cgwalters cgwalters enabled auto-merge November 19, 2024 13:46
@cgwalters cgwalters merged commit 848be3f into containers:main Nov 19, 2024
21 of 32 checks passed
@cgwalters
Copy link
Collaborator Author

I personally find mutations harder to follow as a code reader/debugger, even if they're sometimes "simpler" (mostly in terms of LoC) and more performant, but it's all very subjective

Agreed that the mutation can be confusing, but I think in this case it is clearer than creating a shadowed copy of the same value.

However I have some other followups here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/install Issues related to `bootc install`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants