Skip to content

Change connected() to take &self instead of &mut self#1257

Open
cuishuang wants to merge 2 commits into
rust-lang:mainfrom
cuishuang:main
Open

Change connected() to take &self instead of &mut self#1257
cuishuang wants to merge 2 commits into
rust-lang:mainfrom
cuishuang:main

Conversation

@cuishuang
Copy link
Copy Markdown

The connected method only reads the connection status without mutating state, so &self is sufficient and avoids unnecessary mutable borrow.

Signed-off-by: cuishuang <imcusg@gmail.com>
@rustbot rustbot added the S-waiting-on-review Status: Waiting on review label May 17, 2026
Copy link
Copy Markdown
Contributor

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the various git_remote_connected callbacks in libgit2 there are none that mutate the remote, so looks good to me (once CI passes)

View changes since this review

Signed-off-by: cuishuang <imcusg@gmail.com>
@cuishuang
Copy link
Copy Markdown
Author

Looking at the various git_remote_connected callbacks in libgit2 there are none that mutate the remote, so looks good to me (once CI passes)

View changes since this review

Thanks.

I resubmitted the changes and modified the test cases to pass the CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Waiting on review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants