1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

sync: adjust safety comments

Removes a stale safety comment I missed, plus adds some backticks.
This commit is contained in:
Justin Tracey 2025-05-28 19:27:40 -04:00 committed by GitHub
parent 0523eab9e7
commit 508e791f56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,7 +78,7 @@ mod platform {
use windows_sys::Win32::System::WindowsProgramming::DRIVE_FIXED;
fn get_last_error() -> u32 {
// SAFETY: GetLastError has no safety preconditions
// SAFETY: `GetLastError` has no safety preconditions
unsafe { GetLastError() as u32 }
}
@ -122,8 +122,6 @@ mod platform {
Ok((String::from_wide_null(&name), handle))
}
/// # Safety
/// This function is unsafe because it calls an unsafe function.
fn find_all_volumes() -> UResult<Vec<String>> {
let (first_volume, next_volume_handle) = find_first_volume()?;
let mut volumes = vec![first_volume];
@ -136,7 +134,7 @@ mod platform {
{
return match get_last_error() {
ERROR_NO_MORE_FILES => {
// SAFETY: next_volume_handle was returned by `find_first_volume`
// SAFETY: `next_volume_handle` was returned by `find_first_volume`
unsafe { FindVolumeClose(next_volume_handle) };
Ok(volumes)
}