Skip to content

Commit 43607ce

Browse files
committed
clippy/uefi-raw: streamline lints with main crate
1 parent c70b41a commit 43607ce

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

uefi-raw/src/lib.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
1111
#![no_std]
1212
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
13-
#![deny(missing_debug_implementations)]
14-
#![deny(clippy::all)]
15-
#![deny(clippy::ptr_as_ptr, unused)]
16-
#![deny(clippy::must_use_candidate)]
13+
#![deny(
14+
clippy::all,
15+
clippy::missing_const_for_fn,
16+
clippy::must_use_candidate,
17+
clippy::ptr_as_ptr,
18+
clippy::use_self,
19+
missing_debug_implementations,
20+
unused
21+
)]
1722

1823
#[macro_use]
1924
mod enums;

uefi-raw/src/status.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ impl Status {
104104
#[inline]
105105
#[must_use]
106106
pub fn is_success(self) -> bool {
107-
self == Status::SUCCESS
107+
self == Self::SUCCESS
108108
}
109109

110110
/// Returns true if status code indicates a warning.
111111
#[inline]
112112
#[must_use]
113113
pub fn is_warning(self) -> bool {
114-
(self != Status::SUCCESS) && (self.0 & Self::ERROR_BIT == 0)
114+
(self != Self::SUCCESS) && (self.0 & Self::ERROR_BIT == 0)
115115
}
116116

117117
/// Returns true if the status code indicates an error.

uefi-raw/src/table/boot.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ impl MemoryDescriptor {
367367
}
368368

369369
impl Default for MemoryDescriptor {
370-
fn default() -> MemoryDescriptor {
371-
MemoryDescriptor {
370+
fn default() -> Self {
371+
Self {
372372
ty: MemoryType::RESERVED,
373373
phys_start: 0,
374374
virt_start: 0,
@@ -439,9 +439,9 @@ impl MemoryType {
439439
/// Construct a custom `MemoryType`. Values in the range `0x8000_0000..=0xffff_ffff` are free for use if you are
440440
/// an OS loader.
441441
#[must_use]
442-
pub const fn custom(value: u32) -> MemoryType {
442+
pub const fn custom(value: u32) -> Self {
443443
assert!(value >= 0x80000000);
444-
MemoryType(value)
444+
Self(value)
445445
}
446446
}
447447

uefi-raw/src/table/revision.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Revision {
6161
let major = major as u32;
6262
let minor = minor as u32;
6363
let value = (major << 16) | minor;
64-
Revision(value)
64+
Self(value)
6565
}
6666

6767
/// Returns the major revision.

uefi-raw/src/time.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl Display for Time {
111111

112112
/// The padding fields of `Time` are ignored for comparison.
113113
impl PartialEq for Time {
114-
fn eq(&self, other: &Time) -> bool {
114+
fn eq(&self, other: &Self) -> bool {
115115
self.year == other.year
116116
&& self.month == other.month
117117
&& self.day == other.day

0 commit comments

Comments
 (0)