Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use &self instead of &mut self for poll_accept #54

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

kvinwang
Copy link
Contributor

I encountered trouble when implementing the Listener from rocket for VsockListener, because it uses &self.

impl rocket::listener::Listener for VsockListener {
    type Accept = (vsock::VsockStream, vsock::VsockAddr);

    type Connection = VsockConnection;

    async fn accept(&self) -> io::Result<Self::Accept> {
        let (stream, addr) = self.listener.accept().await?;
        Ok((stream, addr))
    }
...
}

The TcpListener from tokio is also using &self.

So, I think it should also use &self here.

@jalil-salame
Copy link
Contributor

The BVT check is failing due to clippy unused_mut lints, and the commit message is missing an sign off and a body (which is why the commit message check is failing).

@jalil-salame
Copy link
Contributor

@kvinwang the commit message is still missing (as is the sign off), please check the CI error messages: https://github.com/rust-vsock/tokio-vsock/actions/runs/12293688962/job/34306956076?pr=54

As TcpListener in tokio does.

Signed-off-by: Kevin Wang <[email protected]>
@kvinwang
Copy link
Contributor Author

@kvinwang the commit message is still missing (as is the sign off)

Fixed.

@qwandor qwandor merged commit d52af1b into rust-vsock:master Dec 12, 2024
2 checks passed
Tim-Zhang added a commit to Tim-Zhang/tokio-vsock that referenced this pull request Dec 20, 2024
Bump the major version for API has changed in rust-vsock#54 and features
removed in rust-vsock#56

Also this release includes rust-vsock#53 and rust-vsock#55

Signed-off-by: Tim Zhang <[email protected]>
Tim-Zhang added a commit to Tim-Zhang/tokio-vsock that referenced this pull request Dec 20, 2024
Bump the major version for rust-vsock#54 which changed API and rust-vsock#56 which removed features.

Also this release includes rust-vsock#53 and rust-vsock#55.

Signed-off-by: Tim Zhang <[email protected]>
@Tim-Zhang Tim-Zhang mentioned this pull request Dec 20, 2024
Tim-Zhang added a commit to Tim-Zhang/tokio-vsock that referenced this pull request Dec 20, 2024
Bump the major version for rust-vsock#54 which changed API and rust-vsock#56
which removed features.

Also this release includes rust-vsock#53 and rust-vsock#55.

Signed-off-by: Tim Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants