mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 09:23:25 +00:00
Fix multiple issues pointed out by the new compiler
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
5f2bd9d0ac
commit
9e4257b655
@ -104,7 +104,7 @@ impl<'a, T: DirentSerializer> DirentBufferReader<'a, T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: DirentSerializer> DirentVisitor for DirentBufferReader<'a, T> {
|
||||
impl<T: DirentSerializer> DirentVisitor for DirentBufferReader<'_, T> {
|
||||
fn visit(&mut self, name: &str, ino: u64, type_: InodeType, offset: usize) -> Result<()> {
|
||||
let dirent_serializer = T::new(ino, offset as u64, type_, CString::new(name)?);
|
||||
if self.read_len >= self.buffer.len() {
|
||||
|
@ -218,6 +218,7 @@ impl MMapOptions {
|
||||
self.typ
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn flags(&self) -> MMapFlags {
|
||||
self.flags
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ impl From<c_pollfd> for PollFd {
|
||||
|
||||
impl From<PollFd> for c_pollfd {
|
||||
fn from(raw: PollFd) -> Self {
|
||||
let fd = if let Some(fd) = raw.fd() { fd } else { -1 };
|
||||
let fd = raw.fd().unwrap_or(-1);
|
||||
let events = raw.events().bits() as i16;
|
||||
let revents = raw.revents().get().bits() as i16;
|
||||
Self {
|
||||
|
Reference in New Issue
Block a user