Skip to content

Commit 3099bc1

Browse files
committed
Disable some clippy warnings
1 parent e6d94a3 commit 3099bc1

File tree

8 files changed

+13
-0
lines changed

8 files changed

+13
-0
lines changed

src/addr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub struct PhysAddr(u64);
3838
#[derive(Debug)]
3939
pub struct VirtAddrNotValid(u64);
4040

41+
#[allow(clippy::trivially_copy_pass_by_ref)]
4142
impl VirtAddr {
4243
/// Creates a new canonical virtual address.
4344
///
@@ -288,6 +289,7 @@ impl PhysAddr {
288289
}
289290

290291
/// Convenience method for checking if a physical address is null.
292+
#[allow(clippy::trivially_copy_pass_by_ref)]
291293
#[inline]
292294
pub fn is_null(&self) -> bool {
293295
self.0 == 0

src/instructions/random.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
pub struct RdRand(());
66

77
#[cfg(target_arch = "x86_64")]
8+
#[allow(clippy::trivially_copy_pass_by_ref)]
89
impl RdRand {
910
/// Creates Some(RdRand) if RDRAND is supported, None otherwise
1011
pub fn new() -> Option<Self> {

src/structures/gdt.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ impl SegmentSelector {
2626
}
2727

2828
/// Returns the GDT index.
29+
#[allow(clippy::trivially_copy_pass_by_ref)]
2930
#[inline]
3031
pub fn index(&self) -> u16 {
3132
self.0 >> 3
3233
}
3334

3435
/// Returns the requested privilege level.
36+
#[allow(clippy::trivially_copy_pass_by_ref)]
3537
#[inline]
3638
pub fn rpl(&self) -> PrivilegeLevel {
3739
PrivilegeLevel::from_u16(self.0.get_bits(0..2))

src/structures/idt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ impl InterruptStackFrame {
759759
/// can easily lead to undefined behavior. For example, by writing an invalid value to
760760
/// the instruction pointer field, the CPU can jump to arbitrary code at the end of the
761761
/// interrupt.
762+
#[allow(clippy::should_implement_trait)]
762763
#[inline]
763764
pub unsafe fn as_mut(&mut self) -> &mut InterruptStackFrameValue {
764765
&mut self.value

src/structures/paging/frame.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ impl<S: PageSize> PhysFrame<S> {
3636
}
3737

3838
/// Returns the start address of the frame.
39+
#[allow(clippy::trivially_copy_pass_by_ref)]
3940
#[inline]
4041
pub fn start_address(&self) -> PhysAddr {
4142
self.start_address
4243
}
4344

4445
/// Returns the size the frame (4KB, 2MB or 1GB).
46+
#[allow(clippy::trivially_copy_pass_by_ref)]
4547
#[inline]
4648
pub fn size(&self) -> u64 {
4749
S::SIZE

src/structures/paging/mapper/mapped_page_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ impl<'a, P: PhysToVirt> Mapper<Size4KiB> for MappedPageTable<'a, P> {
356356
}
357357

358358
impl<'a, P: PhysToVirt> MapperAllSizes for MappedPageTable<'a, P> {
359+
#[allow(clippy::inconsistent_digit_grouping)]
359360
fn translate(&self, addr: VirtAddr) -> TranslateResult {
360361
let p4 = &self.level_4_table;
361362
let p3 = match self.page_table_walker.next_table(&p4[addr.p4_index()]) {

src/structures/paging/mapper/recursive_page_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ impl<'a> Mapper<Size4KiB> for RecursivePageTable<'a> {
531531
}
532532

533533
impl<'a> MapperAllSizes for RecursivePageTable<'a> {
534+
#[allow(clippy::inconsistent_digit_grouping)]
534535
fn translate(&self, addr: VirtAddr) -> TranslateResult {
535536
let page = Page::containing_address(addr);
536537

src/structures/paging/page.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub struct Page<S: PageSize = Size4KiB> {
5959
size: PhantomData<S>,
6060
}
6161

62+
#[allow(clippy::trivially_copy_pass_by_ref)]
6263
impl<S: PageSize> Page<S> {
6364
/// The page size in bytes.
6465
pub const SIZE: u64 = S::SIZE;
@@ -130,6 +131,7 @@ impl<S: PageSize> Page<S> {
130131

131132
impl<S: NotGiantPageSize> Page<S> {
132133
/// Returns the level 2 page table index of this page.
134+
#[allow(clippy::trivially_copy_pass_by_ref)]
133135
#[inline]
134136
pub fn p2_index(&self) -> PageTableIndex {
135137
self.start_address().p2_index()
@@ -187,6 +189,7 @@ impl Page<Size4KiB> {
187189
}
188190

189191
/// Returns the level 1 page table index of this page.
192+
#[allow(clippy::trivially_copy_pass_by_ref)]
190193
#[inline]
191194
pub fn p1_index(&self) -> PageTableIndex {
192195
self.start_address().p1_index()

0 commit comments

Comments
 (0)