Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add variable key functions touefi::runtime#1252

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
phip1611 merged 4 commits intomainfrombishop-runtime-mod-varkeys-2
Jul 21, 2024

Conversation

nicholasbishop
Copy link
Member

The interface is slightly different than inuefi/src/table/runtime.rs, where we just have a function to get all keys at once in aVec<VariableKey>.

For the new implementation, two interfaces are provided:

get_next_variable_key is a low-level interface that does not require thealloc feature; it's a simple wrapper aroundGetNextVariableName.

variable_keys is a high-level interface that returns an iterator. (Following the conventions of Rust's std lib, the iterator type is namedVariableKeys.) This requiresalloc.

Also:

  • Add standard derives forVariableKey (needed eq for the tests)

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See theRewriting History guide for help.
  • Update the changelog (if necessary)

This will allow it to be used in the new runtime module with freestandingfunctions.
The interface is slightly different than in `uefi/src/table/runtime.rs`,where we just have a function to get all keys at once in a `Vec<VariableKey>`.For the new implementation, two interfaces areprovided:`get_next_variable_key` is a low-level interface that does not requirethe `alloc` feature; it's a simple wrapper around `GetNextVariableName`.`variable_keys` is a high-level interface that returns aniterator. (Following the conventions of Rust's std lib, the iteratortype is named `VariableKeys`.) This requires `alloc`.
@nicholasbishopnicholasbishopforce-pushed thebishop-runtime-mod-varkeys-2 branch fromaca59e9 tobea0fd9CompareJuly 21, 2024 13:08
// list as the `RuntimeServices::variable_keys` function.
assert_eq!(
runtime::variable_keys()
.map(|k| k.unwrap())
Copy link
Member

Choose a reason for hiding this comment

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

nit: could also befilter_map(core::ops::identity) I think

Copy link
Member

@phip1611phip1611 left a comment

Choose a reason for hiding this comment

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

LGTM!

@phip1611phip1611 added this pull request to themerge queueJul 21, 2024
Merged via the queue intomain with commit4fd9aedJul 21, 2024
15 checks passed
@phip1611phip1611 deleted the bishop-runtime-mod-varkeys-2 branchJuly 21, 2024 17:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@phip1611phip1611phip1611 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@nicholasbishop@phip1611

[8]ページ先頭

©2009-2025 Movatter.jp