From e908bd9a174e1e755f5437298f6a0bb2b32dd24a Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 15 Dec 2023 13:06:48 +0900 Subject: [PATCH] simple_op_store: use TryFrom instead of deprecated from_i32() --- lib/src/simple_op_store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/simple_op_store.rs b/lib/src/simple_op_store.rs index 833c00b16..3522bd1e2 100644 --- a/lib/src/simple_op_store.rs +++ b/lib/src/simple_op_store.rs @@ -668,7 +668,7 @@ fn remote_ref_state_to_proto(state: RemoteRefState) -> Option { } fn remote_ref_state_from_proto(proto_value: Option) -> Option { - 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,