Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Apr 26, 2024
1 parent 860a8f7 commit fc9e2d3
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions zenoh/src/net/runtime/adminspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,15 +714,8 @@ fn subscribers_data(context: &AdminContext, query: Query) {
))
.unwrap();
if query.key_expr().intersects(&key) {
let payload = match ZBytes::try_from(
serde_json::to_string(&sub.1).unwrap_or_else(|_| "{}".to_string()),
) {
Ok(p) => p,
Err(e) => {
tracing::error!("Error serializing AdminSpace reply: {:?}", e);
return;
}
};
let payload =
ZBytes::from(serde_json::to_string(&sub.1).unwrap_or_else(|_| "{}".to_string()));
if let Err(e) = query
.reply(key, payload)
.encoding(Encoding::APPLICATION_JSON)
Expand All @@ -745,15 +738,8 @@ fn queryables_data(context: &AdminContext, query: Query) {
))
.unwrap();
if query.key_expr().intersects(&key) {
let payload = match ZBytes::try_from(
serde_json::to_string(&qabl.1).unwrap_or_else(|_| "{}".to_string()),
) {
Ok(p) => p,
Err(e) => {
tracing::error!("Error serializing AdminSpace reply: {:?}", e);
return;
}
};
let payload =
ZBytes::from(serde_json::to_string(&qabl.1).unwrap_or_else(|_| "{}".to_string()));
if let Err(e) = query
.reply(key, payload)
.encoding(Encoding::APPLICATION_JSON)
Expand Down

0 comments on commit fc9e2d3

Please sign in to comment.