Skip to content

Commit

Permalink
fix: allow dead_code
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Feb 23, 2024
1 parent 35b0cc0 commit 4f68844
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/drivers/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub(crate) trait NetworkDriver {
where
F: FnOnce(&mut [u8]) -> R;
/// Check if a packet is available
#[allow(dead_code)]
fn has_packet(&self) -> bool;
/// Enable / disable the polling mode of the network interface
fn set_polling_mode(&mut self, value: bool);
Expand Down
1 change: 1 addition & 0 deletions src/drivers/net/virtio_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ impl NetworkDriver for VirtioNetDriver {
self.checksums.clone()
}

#[allow(dead_code)]
fn has_packet(&self) -> bool {
self.recv_vqs.poll();
!self.recv_vqs.poll_queue.borrow().is_empty()
Expand Down
4 changes: 4 additions & 0 deletions src/fd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,13 @@ pub(crate) trait ObjectInterface: Sync + Send + core::fmt::Debug + DynClone {
}

/// `unlink` removes file entry
#[allow(dead_code)]
fn unlink(&self, _path: &str) -> Result<(), IoError> {
Err(IoError::EINVAL)
}

/// `rmdir` removes directory entry
#[allow(dead_code)]
fn rmdir(&self, _path: &str) -> Result<(), IoError> {
Err(IoError::EINVAL)
}
Expand All @@ -196,6 +198,7 @@ pub(crate) trait ObjectInterface: Sync + Send + core::fmt::Debug + DynClone {
}

/// `mkdir` creates a directory entry
#[allow(dead_code)]
fn mkdir(&self, _path: &str, _mode: u32) -> Result<(), IoError> {
Err(IoError::EINVAL)
}
Expand Down Expand Up @@ -244,6 +247,7 @@ pub(crate) trait ObjectInterface: Sync + Send + core::fmt::Debug + DynClone {

/// `getpeername` get address of connected peer
#[cfg(all(any(feature = "tcp", feature = "udp"), not(feature = "newlib")))]
#[allow(dead_code)]
fn getpeername(&self) -> Option<IpEndpoint> {
None
}
Expand Down
1 change: 1 addition & 0 deletions src/fd/socket/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ impl ObjectInterface for Socket {
}
}

#[allow(dead_code)]
fn getpeername(&self) -> Option<IpEndpoint> {
self.with(|socket| socket.remote_endpoint())
}
Expand Down
2 changes: 2 additions & 0 deletions src/fs/fuse_abi.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

#[cfg(all(feature = "fuse", feature = "pci"))]
pub(crate) const ROOT_ID: u64 = 1;

Expand Down

0 comments on commit 4f68844

Please sign in to comment.