Skip to content

Commit

Permalink
simple_op_store: use TryFrom<i32> instead of deprecated from_i32()
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Feb 10, 2024
1 parent 7aa7cbe commit e908bd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/simple_op_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ fn remote_ref_state_to_proto(state: RemoteRefState) -> Option<i32> {
}

fn remote_ref_state_from_proto(proto_value: Option<i32>) -> Option<RemoteRefState> {
let proto_state = proto_value.and_then(crate::protos::op_store::RemoteRefState::from_i32)?;
let proto_state = proto_value?.try_into().ok()?;
let state = match proto_state {
crate::protos::op_store::RemoteRefState::New => RemoteRefState::New,
crate::protos::op_store::RemoteRefState::Tracking => RemoteRefState::Tracking,
Expand Down

0 comments on commit e908bd9

Please sign in to comment.