Skip to content

Commit 36f37cc

Browse files
RenTrieuphip1611
andauthored
uefi: Revise env functions to use panicking function calls
Co-authored-by: Philipp Schuster <[email protected]>
1 parent dc388f7 commit 36f37cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

uefi/src/proto/shell/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ impl Shell {
6161
let mut null_count = 0;
6262
unsafe {
6363
while null_count <= 1 {
64-
if (*(cur_env_ptr.add(i))) == Char16::from_u16_unchecked(0).into() {
64+
if (*(cur_env_ptr.add(i))) == Char16::from_u16(0).unwrap().into() {
6565
if cur_len > 0 {
66-
env_vec.push(CStr16::from_char16_with_nul_unchecked(
66+
env_vec.push(CStr16::from_char16_with_nul(
6767
&(*ptr::slice_from_raw_parts(cur_start.cast(), cur_len + 1)),
6868
));
6969
}
@@ -88,7 +88,7 @@ impl Shell {
8888
///
8989
/// * `name` - The environment variable for which to set the value
9090
/// * `value` - The new value of the environment variable
91-
/// * `volatile` - Indicates whether or not the variable is volatile or
91+
/// * `volatile` - Indicates whether the variable is volatile or
9292
/// not
9393
///
9494
/// # Returns

0 commit comments

Comments
 (0)