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

Trait methods should not take patterns like mut IDENT as arguments #354

Open
l2dy opened this issue Aug 17, 2024 · 0 comments
Open

Trait methods should not take patterns like mut IDENT as arguments #354

l2dy opened this issue Aug 17, 2024 · 0 comments
Labels
ergonomics Ease of use, developer friendliness Refactor Code refactor or clean up. No or little functional changes.

Comments

@l2dy
Copy link
Contributor

l2dy commented Aug 17, 2024

According to E0642 and rust-lang/rust#35203, trait methods should not take patterns as arguments, including patterns like mut IDENT. But Pingora is using it in several places.

async fn start(&self, mut shutdown: ShutdownWatch);

mut session: Stream,

mut session: ServerSession,

async fn start_service(&mut self, fds: Option<ListenFds>, mut shutdown: ShutdownWatch);

Without function body, mut seems ineffective. Is there a good reason to keep them?

Pingora info

Please include the following information about your environment:

Pingora version: commit b0bd0fb
Rust version: cargo 1.80.1 (376290515 2024-07-16)
Operating system version: N/A

@eaufavor eaufavor added the Refactor Code refactor or clean up. No or little functional changes. label Aug 30, 2024
@eaufavor eaufavor added the ergonomics Ease of use, developer friendliness label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ergonomics Ease of use, developer friendliness Refactor Code refactor or clean up. No or little functional changes.
Projects
None yet
Development

No branches or pull requests

2 participants