Skip to content

Commit 6d94599

Browse files
committed
Quiet some warns with Todos
1 parent 2e7e06a commit 6d94599

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

io-uring-bearer/src/fixed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use slab::{Slab, VacantEntry};
99

1010
#[derive(Clone, Debug)]
1111
pub(crate) struct FixedFdRegister {
12+
#[allow(dead_code)]
1213
fno2fixed: SelectedHashMap<u32, u32, SelectedHasher<u32>>,
1314
fixed_ord: Slab<(u32, RegisteredFd)>,
1415
capacity: u32,

io-uring-bearer/src/slab/buffer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl ProvideBuffersRec {
8484

8585
/// Mutable Buffer is taken by something, let's provide it intermediate type.
8686
#[derive(Clone, Debug)]
87+
#[allow(dead_code)]
8788
pub(crate) struct TakenMutableBuffer {
8889
pub(crate) buf_idx: usize,
8990
pub(crate) buf_mut_u8: *mut u8,
@@ -108,6 +109,7 @@ pub(crate) fn take_one_mutable_buffer_raw(
108109

109110
/// Buffer is taken by something for Read-Only, let's provide it intermediate type.
110111
#[derive(Clone, Debug)]
112+
#[allow(dead_code)]
111113
pub(crate) struct TakenImmutableBuffer {
112114
pub(crate) buf_idx: usize,
113115
pub(crate) buf_const_u8: *const u8,

io-uring-bearer/src/slab/send_zc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub struct SendZcFixedRec {
2020
fixed_fd: u32,
2121
owner: Owner,
2222
buf_taken: TakenImmutableBuffer,
23+
#[allow(dead_code)]
2324
to_addr: Option<DestTo>,
2425
}
2526

@@ -30,6 +31,7 @@ pub struct SendZcUnsafeRefRec {
3031
owner: Owner,
3132
buf_const_u8: *const u8,
3233
buf_size: u32,
34+
#[allow(dead_code)]
3335
to_addr: Option<DestTo>,
3436
}
3537

@@ -80,20 +82,23 @@ impl SendZcRec {
8082

8183
/// When SendTo is sepcified, send(2) is turned into sendto(2)
8284
#[derive(Clone, Debug)]
85+
#[allow(dead_code)]
8386
pub enum DestTo {
8487
V4(DestToV4),
8588
V6(DestToV6),
8689
}
8790

8891
/// IPv4 SendTo
8992
#[derive(Clone, Debug)]
93+
#[allow(dead_code)]
9094
pub struct DestToV4 {
9195
pub(crate) sockaddr: libc::sockaddr_in,
9296
pub(crate) socklen_t: libc::socklen_t,
9397
}
9498

9599
/// IPv6 SendTo
96100
#[derive(Clone, Debug)]
101+
#[allow(dead_code)]
97102
pub struct DestToV6 {
98103
pub(crate) sockaddr: libc::sockaddr_in6,
99104
pub(crate) socklen_t: libc::socklen_t,

io-uring-bearer/src/uring.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<C: core::fmt::Debug + Clone + OpCompletion> UringBearer<C> {
111111
{
112112
// SAFETY: We Retain the original submission record and don't move it.
113113
unsafe {
114-
self.handle_completions(user, |u, e, rec| {
114+
self.handle_completions(user, None, |u, e, rec| {
115115
func(u, e, rec);
116116
SubmissionRecordStatus::Retain
117117
})
@@ -130,14 +130,15 @@ impl<C: core::fmt::Debug + Clone + OpCompletion> UringBearer<C> {
130130
pub unsafe fn handle_completions<F, U>(
131131
&mut self,
132132
user: &mut U,
133+
#[allow(unused_variables)] limit: Option<u32>,
133134
func: F,
134135
) -> Result<(), UringBearerError>
135136
where
136137
F: Fn(&mut U, &io_uring::cqueue::Entry, &Completion<C>) -> SubmissionRecordStatus,
137138
{
138139
let iou = &mut self.io_uring;
139-
let c_queue = iou.completion();
140-
for item in c_queue {
140+
let mut c_queue = iou.completion();
141+
while let Some(item) = c_queue.next() {
141142
let key = item.user_data();
142143
let a_rec_t = self
143144
.fd_slab

0 commit comments

Comments
 (0)