Skip to content

Commit

Permalink
harden ref mut according to edition 2024
Browse files Browse the repository at this point in the history
Signed-off-by: Xinye Tao <[email protected]>
  • Loading branch information
Xinye Tao committed Feb 25, 2025
1 parent 846c452 commit 9df13e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions prost-build/src/message_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,10 @@ 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

0 comments on commit 9df13e1

Please sign in to comment.