Skip to content

Commit 9a1acee

Browse files
committed
fix issue, updating to be compatible with: rust-lang/rust#85482
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
1 parent 49fe340 commit 9a1acee

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

znrpc-macros/examples/expanded.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ where
9999
{
100100
let zinfo = _self.z.info().await;
101101
let pid = zinfo
102-
.get(&zenoh::net::info::ZN_INFO_PID_KEY)?
102+
.get(&zenoh::net::info::ZN_INFO_PID_KEY)
103+
.ok_or(ZRPCError::MissingValue)?
103104
.to_uppercase();
104105
let rid = match zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY) {
105106
Some(r_info) => {

znrpc-macros/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ impl<'a> ZNServiceGenerator<'a> {
638638
S: #service_ident + Send + 'static,
639639
{
640640
let zinfo = _self.z.info().await;
641-
let pid = zinfo.get(&zenoh::net::info::ZN_INFO_PID_KEY)?.to_uppercase();
641+
let pid = zinfo.get(&zenoh::net::info::ZN_INFO_PID_KEY).ok_or(ZRPCError::MissingValue)?.to_uppercase();
642642
let rid = match zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY) {
643643
Some(r_info) => {
644644
if r_info != "" {

zrpc-macros/examples/zworking.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ where
7272
let zsession = _self.z.session();
7373
let zinfo = zsession.info().await;
7474
let pid = zinfo
75-
.get(&zenoh::net::info::ZN_INFO_PID_KEY)?
75+
.get(&zenoh::net::info::ZN_INFO_PID_KEY)
76+
.ok_or(ZRPCError::MissingValue)?
7677
.to_uppercase();
7778
let rid = zinfo
78-
.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)?
79+
.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)
80+
.ok_or(ZRPCError::MissingValue)?
7981
.split(',')
8082
.collect::<Vec<_>>()[0]
8183
.to_uppercase();
@@ -563,7 +565,8 @@ impl HelloClient {
563565
let zsession = z.session();
564566
let zinfo = zsession.info().await;
565567
let rid = zinfo
566-
.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)?
568+
.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)
569+
.ok_or(ZRPCError::MissingValue)?
567570
.split(',')
568571
.collect::<Vec<_>>()[0]
569572
.to_uppercase();

zrpc-macros/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ impl<'a> ZServiceGenerator<'a> {
515515

516516
let zsession = _self.z.session();
517517
let zinfo = zsession.info().await;
518-
let pid = zinfo.get(&zenoh::net::info::ZN_INFO_PID_KEY)?.to_uppercase();
519-
let rid = zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)?.split(",").collect::<Vec<_>>()[0].to_uppercase();
518+
let pid = zinfo.get(&zenoh::net::info::ZN_INFO_PID_KEY).ok_or(ZRPCError::MissingValue)?.to_uppercase();
519+
let rid = zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY).ok_or(ZRPCError::MissingValue)?.split(",").collect::<Vec<_>>()[0].to_uppercase();
520520
let ws = _self.z.workspace(None).await?;
521521

522522

@@ -1159,7 +1159,7 @@ impl<'a> ZServiceGenerator<'a> {
11591159
let ws = z.workspace(None).await?;
11601160
let zsession = z.session();
11611161
let zinfo = zsession.info().await;
1162-
let rid = zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)?.split(",").collect::<Vec<_>>()[0].to_uppercase();
1162+
let rid = zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY).ok_or(ZRPCError::MissingValue)?.split(",").collect::<Vec<_>>()[0].to_uppercase();
11631163

11641164
let selector = zenoh::Selector::try_from(format!("{}/*/state",#eval_path))?;
11651165
let mut ds = ws.get(&selector).await?;

zrpc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* ADLINK fog05 team, <fog05@adlink-labs.tech>
1212
*********************************************************************************/
1313
#![feature(associated_type_bounds)]
14-
#![feature(try_trait)]
1514
#![allow(clippy::upper_case_acronyms)]
1615

1716
pub mod zchannel;

zrpc/src/zrpcresult.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@ impl From<zenoh::ZError> for ZRPCError {
104104
}
105105
}
106106

107-
impl From<std::option::NoneError> for ZRPCError {
108-
fn from(_err: std::option::NoneError) -> Self {
109-
ZRPCError::MissingValue
110-
}
111-
}
107+
112108
impl From<std::io::Error> for ZRPCError {
113109
fn from(err: std::io::Error) -> Self {
114110
ZRPCError::IOError(err.to_string())

0 commit comments

Comments
 (0)