Skip to content

Commit 90172b1

Browse files
committed
Fix logic
1 parent 4024d37 commit 90172b1

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ jobs:
7373
uses: actions-rs/cargo@v1
7474
with:
7575
command: clippy
76-
args: --all-features -- -D warnings
76+
args: --all-features -- -D warnings -A clippy::redundant-clone

src/sio/client.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,11 @@ impl<'a> ClientInfo<'a> {
296296
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('"', ""))) {
297297
None => {
298298
warn!("clu_name Not found using clu_id as name");
299-
None
299+
clu_id.to_string()
300300
},
301-
Some(s) => Some(s),
301+
Some(s) => s,
302302
};
303303

304-
let clu_name = if let Some(id) = clu_name { id } else { clu_name.unwrap() };
305-
306304
// System
307305
{
308306
let mut label: HashMap<&'static str, String> = HashMap::new();

src/sio/metrics.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ fn convert_states(instances: &Map<String, serde_json::Value>, relations: &HashMa
5151
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('"', ""))) {
5252
None => {
5353
warn!("clu_name Not found using clu_id as name");
54-
None
54+
clu_id.to_string()
5555
},
56-
Some(s) => Some(s),
56+
Some(s) => s,
5757
};
58-
let clu_name = if let Some(id) = clu_name { id } else { clu_name.unwrap() };
5958

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

0 commit comments

Comments
 (0)