Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ce8192

Browse files
committed
fix(driver): stub driver is broken
1 parent fbb8890 commit 9ce8192

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

compio-driver/src/sys/stub/mod.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,39 +55,35 @@ impl Driver {
5555
stub_unimpl()
5656
}
5757

58-
pub fn attach(&mut self, _fd: RawFd) -> io::Result<()> {
58+
pub fn attach(&mut self, _: RawFd) -> io::Result<()> {
5959
Err(stub_error())
6060
}
6161

62-
pub fn cancel(&mut self, _op: &mut Key<dyn OpCode>) {
62+
pub fn cancel(&mut self, _: &mut Key<dyn OpCode>) {
6363
stub_unimpl()
6464
}
6565

66-
pub fn create_op<T: OpCode + 'static>(&self, _op: T) -> Key<T> {
66+
pub fn create_op<T: OpCode + 'static>(&self, _: T) -> Key<T> {
6767
stub_unimpl()
6868
}
6969

70-
pub fn push(&mut self, _op: &mut Key<dyn crate::sys::OpCode>) -> Poll<io::Result<usize>> {
70+
pub fn push(&mut self, _: &mut Key<dyn crate::sys::OpCode>) -> Poll<io::Result<usize>> {
7171
Poll::Ready(Err(stub_error()))
7272
}
7373

74-
pub fn poll(&mut self, _timeout: Option<Duration>) -> io::Result<()> {
74+
pub fn poll(&mut self, _: Option<Duration>) -> io::Result<()> {
7575
Err(stub_error())
7676
}
7777

7878
pub fn waker(&self) -> Waker {
7979
futures_util::task::noop_waker()
8080
}
8181

82-
pub fn create_buffer_pool(
83-
&mut self,
84-
_buffer_len: u16,
85-
_buffer_size: usize,
86-
) -> io::Result<BufferPool> {
82+
pub fn create_buffer_pool(&mut self, _: u16, _: usize) -> io::Result<BufferPool> {
8783
Err(stub_error())
8884
}
8985

90-
pub unsafe fn release_buffer_pool(&mut self, _buffer_pool: BufferPool) -> io::Result<()> {
86+
pub unsafe fn release_buffer_pool(&mut self, _: BufferPool) -> io::Result<()> {
9187
Err(stub_error())
9288
}
9389
}

compio-driver/src/sys/stub/op.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
#![allow(dead_code)]
2+
13
use std::ffi::CString;
24

35
use compio_buf::{BufResult, IntoInner, IoBuf, IoBufMut, IoVectoredBuf, IoVectoredBufMut};
46
use socket2::{SockAddr, SockAddrStorage, socklen_t};
57

68
use super::{OpCode, stub_unimpl};
7-
pub use crate::unix::op::*;
9+
pub use crate::sys::unix_op::*;
810
use crate::{AsFd, op::*};
911

1012
impl<
@@ -28,7 +30,7 @@ impl OpCode for CloseFile {}
2830

2931
/// Get metadata of an opened file.
3032
pub struct FileStat<S> {
31-
pub(crate) fd: S,
33+
fd: S,
3234
}
3335

3436
impl<S> FileStat<S> {

0 commit comments

Comments
 (0)