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

cstr[ing]16: convenience functions #751

Merged
merged 1 commit into from
Apr 5, 2023
Merged

Conversation

phip1611
Copy link
Contributor

@phip1611 phip1611 commented Apr 2, 2023

For #747 I'm about to add a PathBuf struct as wrapper around CString16, akin to the standard library. For this, a lot of convenience functions are missing on CStr16 and CString16. This PR adds those.

Checklist

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

uefi/src/data_types/owned_strs.rs Outdated Show resolved Hide resolved
uefi/src/data_types/owned_strs.rs Outdated Show resolved Hide resolved
pub struct CString16(Vec<Char16>);

impl CString16 {
/// Creates a new empty string with a null-byte.
Copy link
Member

Choose a reason for hiding this comment

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

"null character" rather than null byte, since for a Char16 it's two bytes.

uefi/src/data_types/owned_strs.rs Outdated Show resolved Hide resolved
uefi/src/data_types/owned_strs.rs Outdated Show resolved Hide resolved
uefi/src/data_types/owned_strs.rs Outdated Show resolved Hide resolved
uefi/src/data_types/owned_strs.rs Outdated Show resolved Hide resolved
uefi/src/data_types/strs.rs Outdated Show resolved Hide resolved
@phip1611 phip1611 force-pushed the str branch 2 times, most recently from e93168b to 6796370 Compare April 3, 2023 07:56
@phip1611
Copy link
Contributor Author

phip1611 commented Apr 3, 2023

I think I addressed all points. Thanks for the feedback. Are we good to go now?

Copy link
Member

@nicholasbishop nicholasbishop left a comment

Choose a reason for hiding this comment

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

There's one more "null-byte" comment that should be updated to "null character", otherwise LGTM.

@phip1611 phip1611 merged commit 46069ef into rust-osdev:main Apr 5, 2023
@phip1611 phip1611 deleted the str branch April 5, 2023 08:28
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