Skip to content

Commit 824f067

Browse files
committed
Fixes suggested in PR
1 parent d48d07d commit 824f067

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

library/std/src/sys/uefi/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pub mod memchr {
4848
pub use core::slice::memchr::{memchr, memrchr};
4949
}
5050

51+
// SAFETY: must be called only once during runtime initialization.
52+
// SAFETY: argc must be 2.
53+
// SAFETY: argv must be &[Handle, *mut SystemTable].
5154
pub unsafe fn init(argc: isize, argv: *const *const u8, _sigpipe: u8) {
5255
assert_eq!(argc, 2);
5356
let image_handle = unsafe { NonNull::new(*argv as *mut crate::ffi::c_void).unwrap() };
@@ -66,10 +69,7 @@ pub const fn unsupported<T>() -> std_io::Result<T> {
6669

6770
#[inline]
6871
pub const fn unsupported_err() -> std_io::Error {
69-
std_io::const_io_error!(
70-
std_io::ErrorKind::Unsupported,
71-
"operation not supported on this platform",
72-
)
72+
std_io::const_io_error!(std_io::ErrorKind::Unsupported, "operation not supported on UEFI",)
7373
}
7474

7575
pub fn decode_error_kind(code: i32) -> crate::io::ErrorKind {
@@ -114,7 +114,7 @@ pub fn hashmap_random_keys() -> (u64, u64) {
114114
unsafe { (get_random().unwrap_or(1), get_random().unwrap_or(2)) }
115115
}
116116

117-
unsafe fn get_random() -> Option<u64> {
117+
fn get_random() -> Option<u64> {
118118
use r_efi::protocols::rng;
119119

120120
let mut buf = [0u8; 8];

library/std/src/sys/uefi/net/tcp4.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::sys::uefi::{
1212
use r_efi::efi::Status;
1313
use r_efi::protocols::{ip4, managed_network, simple_network, tcp4};
1414

15-
// FIXME: Discuss what the values these constants should have
1615
const TYPE_OF_SERVICE: u8 = 8;
1716
const TIME_TO_LIVE: u8 = 255;
1817

0 commit comments

Comments
 (0)