Skip to content

Commit 05a85b3

Browse files
committed
chore: appease clippy
- use div_ceil - no empty lines after doc comments - more sophisticated lifetime elision Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
1 parent e3db410 commit 05a85b3

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/bitmap/backend/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<B> BaseSlice<B> {
2626
}
2727
}
2828

29-
impl<'a, B> WithBitmapSlice<'a> for BaseSlice<B>
29+
impl<B> WithBitmapSlice<'_> for BaseSlice<B>
3030
where
3131
B: Clone + Deref,
3232
B::Target: Bitmap,

src/bitmap/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ pub trait Bitmap: for<'a> WithBitmapSlice<'a> {
4949

5050
/// A no-op `Bitmap` implementation that can be provided for backends that do not actually
5151
/// require the tracking functionality.
52-
53-
impl<'a> WithBitmapSlice<'a> for () {
52+
impl WithBitmapSlice<'_> for () {
5453
type S = Self;
5554
}
5655

@@ -67,7 +66,6 @@ impl Bitmap for () {
6766
}
6867

6968
/// A `Bitmap` and `BitmapSlice` implementation for `Option<B>`.
70-
7169
impl<'a, B> WithBitmapSlice<'a> for Option<B>
7270
where
7371
B: WithBitmapSlice<'a>,

src/mmap_xen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ fn page_size() -> u64 {
489489

490490
fn pages(size: usize) -> (usize, usize) {
491491
let page_size = page_size() as usize;
492-
let num = (size + page_size - 1) / page_size;
492+
let num = size.div_ceil(page_size);
493493

494494
(num, page_size * num)
495495
}

src/volatile_memory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ pub struct VolatileRef<'a, T, B = ()> {
10381038
mmap: Option<&'a MmapInfo>,
10391039
}
10401040

1041-
impl<'a, T> VolatileRef<'a, T, ()>
1041+
impl<T> VolatileRef<'_, T, ()>
10421042
where
10431043
T: ByteValued,
10441044
{
@@ -1181,7 +1181,7 @@ pub struct VolatileArrayRef<'a, T, B = ()> {
11811181
mmap: Option<&'a MmapInfo>,
11821182
}
11831183

1184-
impl<'a, T> VolatileArrayRef<'a, T>
1184+
impl<T> VolatileArrayRef<'_, T>
11851185
where
11861186
T: ByteValued,
11871187
{

0 commit comments

Comments
 (0)