Add get_app_at_slot method to retrieve descriptor for any index#9
Merged
jerrysxie merged 1 commit intoOpenDevicePartnership:mainfrom Mar 25, 2025
Merged
Conversation
JamesHuard
previously approved these changes
Mar 25, 2025
felipebalbi
requested changes
Mar 25, 2025
felipebalbi
left a comment
There was a problem hiding this comment.
Please rebase on current main and make sure to combine commits such that each commit in your PR compiles and runs without known issues.
1868ee7 to
1892b3b
Compare
JamesHuard
previously approved these changes
Mar 25, 2025
There was a problem hiding this comment.
Pull Request Overview
This pull request adds a new method to the BootableRegionDescriptors struct to allow retrieval of a descriptor for a specified app slot while ensuring the provided index is valid. It also updates the Rust minimal supported version (msrv) in the workflow configuration.
- Added the get_app_at_slot method in src/lib.rs to retrieve an app descriptor at a given index.
- Updated the msrv from 1.79 to 1.84 in the GitHub Actions workflow.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/lib.rs | Added the get_app_at_slot method with an index bounds check and call to from_region. |
| .github/workflows/check.yml | Updated the msrv version to support new namespaced features. |
Comments suppressed due to low confidence (1)
src/lib.rs:192
- [nitpick] Consider renaming the parameter 'app_index' to 'app_slot' for consistency with other code references such as the 'app_slot' parameter in from_region and 'num_app_slots' in the header.
pub fn get_app_at_slot(&self, app_index: u32) -> Result<AppImageDescriptor, ParseError> {
2eb24c5 to
69f9af3
Compare
felipebalbi
requested changes
Mar 25, 2025
felipebalbi
left a comment
There was a problem hiding this comment.
Not all commits compile. Additionally, you still have a few clippy errors.
slot Reword parameter name to app_slot Fix app_slot reference
69f9af3 to
da186e8
Compare
JamesHuard
approved these changes
Mar 25, 2025
felipebalbi
approved these changes
Mar 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For the
BootableRegionDescriptorsobject to return theAppImageDescriptorfrom an app at any specified index. The newget_app_at_slot(idx)method will verify the index is within the number of app slots then return the specified app descriptor.