Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
syepes committed Jun 29, 2023
1 parent 4024d37 commit 90172b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
args: --all-features -- -D warnings -A clippy::redundant-clone
6 changes: 2 additions & 4 deletions src/sio/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,11 @@ impl<'a> ClientInfo<'a> {
let clu_name = match instances.get("System").and_then(|o| o.as_object().and_then(|j| j.get("name")).map(|s| s.to_string().replace('"', ""))) {
None => {
warn!("clu_name Not found using clu_id as name");
None
clu_id.to_string()
},
Some(s) => Some(s),
Some(s) => s,
};

let clu_name = if let Some(id) = clu_name { id } else { clu_name.unwrap() };

// System
{
let mut label: HashMap<&'static str, String> = HashMap::new();
Expand Down
5 changes: 2 additions & 3 deletions src/sio/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ fn convert_states(instances: &Map<String, serde_json::Value>, relations: &HashMa
let clu_name = match instances.get("System").and_then(|o| o.as_object().and_then(|j| j.get("name")).map(|s| s.to_string().replace('"', ""))) {
None => {
warn!("clu_name Not found using clu_id as name");
None
clu_id.to_string()
},
Some(s) => Some(s),
Some(s) => s,
};
let clu_name = if let Some(id) = clu_name { id } else { clu_name.unwrap() };

// Sdc
for sdc in instances.get("sdcList").and_then(|v| v.as_array()).unwrap_or_else(|| {
Expand Down

0 comments on commit 90172b1

Please sign in to comment.