Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy: fix #1602

Merged
merged 1 commit into from
Apr 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uefi/src/proto/console/pointer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ pub struct Pointer(SimplePointerProtocol);
impl Pointer {
/// Resets the pointer device hardware.
///
/// # Arguments
/// The `extended_verification` parameter is used to request that UEFI
/// performs an extended check and reset of the input device.
///
/// # Errors
///
/// - `DeviceError` if the device is malfunctioning and cannot be reset.
pub fn reset(&mut self, extended_verification: bool) -> Result {
unsafe { (self.0.reset)(&mut self.0, extended_verification.into()) }.to_result()
Expand Down
1 change: 1 addition & 0 deletions uefi/src/proto/driver/component_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl ComponentName {
///
/// [ISO 639-2]: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
/// [RFC 4646]: https://www.rfc-editor.org/rfc/rfc4646
#[allow(clippy::missing_const_for_fn)] // false-positive since Rust 1.86
pub fn supported_languages(&self) -> core::result::Result<LanguageIter, LanguageError> {
match self {
Self::V1(cn1) => cn1.supported_languages(),
Expand Down
19 changes: 10 additions & 9 deletions uefi/src/proto/media/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ impl BlockIO {
/// Resets the block device hardware.
///
/// # Arguments
/// * `extended_verification` Indicates that the driver may perform a more exhaustive verification operation of
/// the device during reset.
/// * `extended_verification` Indicates that the driver may perform a more
/// exhaustive verification operation of the device during reset.
///
/// # Errors
/// * `uefi::Status::DEVICE_ERROR` The block device is not functioning correctly and could not be reset.
/// * `uefi::Status::DEVICE_ERROR` The block device is not functioning
/// correctly and could not be reset.
pub fn reset(&mut self, extended_verification: bool) -> Result {
unsafe { (self.0.reset)(&mut self.0, extended_verification.into()) }.to_result()
}
Expand All @@ -41,13 +42,13 @@ impl BlockIO {
///
/// # Errors
/// * `uefi::Status::DEVICE_ERROR` The device reported an error while attempting to perform the read
/// operation.
/// operation.
/// * `uefi::Status::NO_MEDIA` There is no media in the device.
/// * `uefi::Status::MEDIA_CHANGED` The `media_id` is not for the current media.
/// * `uefi::Status::BAD_BUFFER_SIZE` The buffer size parameter is not a multiple of the intrinsic block size of
/// the device.
/// the device.
/// * `uefi::Status::INVALID_PARAMETER` The read request contains LBAs that are not valid, or the buffer is not on
/// proper alignment.
/// proper alignment.
pub fn read_blocks(&self, media_id: u32, lba: Lba, buffer: &mut [u8]) -> Result {
let buffer_size = buffer.len();
unsafe {
Expand All @@ -74,11 +75,11 @@ impl BlockIO {
/// * `uefi::Status::NO_MEDIA` There is no media in the device.
/// * `uefi::Status::MEDIA_CHANGED` The `media_id` is not for the current media.
/// * `uefi::Status::DEVICE_ERROR` The device reported an error while attempting to perform the write
/// operation.
/// operation.
/// * `uefi::Status::BAD_BUFFER_SIZE` The buffer size parameter is not a multiple of the intrinsic block size
/// of the device.
/// of the device.
/// * `uefi::Status::INVALID_PARAMETER` The write request contains LBAs that are not valid, or the buffer is not
/// on proper alignment.
/// on proper alignment.
pub fn write_blocks(&mut self, media_id: u32, lba: Lba, buffer: &[u8]) -> Result {
let buffer_size = buffer.len();
unsafe {
Expand Down
3 changes: 1 addition & 2 deletions uefi/src/proto/media/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ impl DiskIo2 {
/// Terminates outstanding asynchronous requests to the device.
///
/// # Errors:
/// * [`Status::DEVICE_ERROR`] The device reported an error while performing
/// the cancel operation.
/// * [`Status::DEVICE_ERROR`] The device reported an error while performing
pub fn cancel(&mut self) -> Result {
unsafe { (self.0.cancel)(&mut self.0) }.to_result()
}
Expand Down
1 change: 1 addition & 0 deletions uefi/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ pub struct VariableKey {
impl VariableKey {
/// Name of the variable.
#[deprecated = "Use the VariableKey.name field instead"]
#[allow(clippy::missing_const_for_fn)] // false-positive since Rust 1.86
pub fn name(&self) -> core::result::Result<&CStr16, crate::data_types::FromSliceWithNulError> {
Ok(&self.name)
}
Expand Down