You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR is split off from rust-lang#135368 to reduce noise.
No real functionality changes, just some quality of life improvements.
Introduce `device_path_to_text_raw` which creates a Box<[u16]> (UTF-16
string) from path instead of creating OsString. OsString internally is
stored as WTF-8, which means converting OsString to Box<[u16]> requires
allocation. This is not ideal for std::fs APIs where we need to perform
Device Path Protocol matching while opening a volume, and create a UEFI
UTF-16 string from the remaining path (which represents file path inside
a volume). This remaining path is never used on the Rust side, and thus
does not need to be converted to WTF-8 to be used. By introducing direct
conversion to Box<[u16]>, we shorten the conversions from
`EFI_DEVICE_PATH_PROTOCOL` -> WTF-8 -> UTF-16 to
`EFI_DEVICE_PATH_PROTOCOL` -> UTF-16 which is required in every file
open operation.
Also implement Debug for OwnedDevicePath for some quality of life
improvements.
Signed-off-by: Ayush Singh <[email protected]>
0 commit comments