Open chenyukang opened 11 months ago
I think in general, suggesting to change the signature is probably not a super great idea, unless we have very strong signal that it's going to be the right choice. For example, we need to at least check that the receiver is Sync
, or else even &self
is wrong.
But even then, I do think that after users apply the suggestion, they'll almost surely hit more borrow-checker errors. People don't typically have fn(self)
when fn(&self)
could work instead -- they're usually consuming some part of Self
.
Code
Current output
Desired output
Rationale and extra context
This may be a relatively easy mistake to make, and the current error message does not seem to help beginners solve the problem very well.
Other cases
No response
Anything else?
When there is more code in fn
start
(e.g, we changeself
to&self
in this line: https://github.com/nervosnetwork/ckb/blob/c77a927c1c44b5969b722c731f774c22ab194ff2/db-migration/src/lib.rs#L55), there may be this error messages, again, it's better if we could suggesting how to fix the code.