Change connected() to take &self instead of &mut self#1257
Conversation
Signed-off-by: cuishuang <imcusg@gmail.com>
Signed-off-by: cuishuang <imcusg@gmail.com>
Thanks. I resubmitted the changes and modified the test cases to pass the CI |
|
Is this safe even with a custom transport? The transport vtable does not seem to enforce this as const or have any comments or contracts around that. |
Oh, I missed the custom transport case. Even though |
The connected method only reads the connection status without mutating state, so &self is sufficient and avoids unnecessary mutable borrow.