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

harden ref mut according to edition 2024 #1248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions prost-build/src/message_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ impl MessageGraph {
}

fn get_or_insert_index(&mut self, msg_name: String) -> NodeIndex {
let MessageGraph {
ref mut index,
ref mut graph,
..
} = *self;
assert_eq!(b'.', msg_name.as_bytes()[0]);
*index
*self
.index
.entry(msg_name.clone())
.or_insert_with(|| graph.add_node(msg_name))
.or_insert_with(|| self.graph.add_node(msg_name))
}

/// Adds message to graph IFF it contains a non-repeated field containing another message.
Expand Down
2 changes: 1 addition & 1 deletion prost-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ fn try_oneof(input: TokenStream) -> Result<TokenStream, Error> {
quote! {
#tag => {
match field {
::core::option::Option::Some(#ident::#variant_ident(ref mut value)) => {
&mut ::core::option::Option::Some(#ident::#variant_ident(ref mut value)) => {
#merge
},
_ => {
Expand Down