mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
sync: adjust safety comments
Removes a stale safety comment I missed, plus adds some backticks.
This commit is contained in:
parent
0523eab9e7
commit
508e791f56
1 changed files with 2 additions and 4 deletions
|
@ -78,7 +78,7 @@ mod platform {
|
||||||
use windows_sys::Win32::System::WindowsProgramming::DRIVE_FIXED;
|
use windows_sys::Win32::System::WindowsProgramming::DRIVE_FIXED;
|
||||||
|
|
||||||
fn get_last_error() -> u32 {
|
fn get_last_error() -> u32 {
|
||||||
// SAFETY: GetLastError has no safety preconditions
|
// SAFETY: `GetLastError` has no safety preconditions
|
||||||
unsafe { GetLastError() as u32 }
|
unsafe { GetLastError() as u32 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,8 +122,6 @@ mod platform {
|
||||||
Ok((String::from_wide_null(&name), handle))
|
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>> {
|
fn find_all_volumes() -> UResult<Vec<String>> {
|
||||||
let (first_volume, next_volume_handle) = find_first_volume()?;
|
let (first_volume, next_volume_handle) = find_first_volume()?;
|
||||||
let mut volumes = vec![first_volume];
|
let mut volumes = vec![first_volume];
|
||||||
|
@ -136,7 +134,7 @@ mod platform {
|
||||||
{
|
{
|
||||||
return match get_last_error() {
|
return match get_last_error() {
|
||||||
ERROR_NO_MORE_FILES => {
|
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) };
|
unsafe { FindVolumeClose(next_volume_handle) };
|
||||||
Ok(volumes)
|
Ok(volumes)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue