Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranay Tulugu committed Jul 25, 2023
1 parent c853ba0 commit d2c0ee7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 41 deletions.
42 changes: 7 additions & 35 deletions althea_types/src/wifi_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,11 @@ fn get_struct_stat(station: Vec<&str>) -> WifiStationData {
}
"authorized:" => {
let next_str = iter.next().unwrap();
if *next_str == "yes" {
ret.authorized = true;
} else {
ret.authorized = false;
}
ret.authorized = *next_str == "yes";
}
"authenticated:" => {
let next_str = iter.next().unwrap();
if *next_str == "yes" {
ret.authenticated = true;
} else {
ret.authenticated = false;
}
ret.authenticated = *next_str == "yes";
}
"[boottime]:" => {
ret.associated_at_boottime_sec = Some(iter.next().unwrap().to_string())
Expand All @@ -227,36 +219,20 @@ fn get_struct_stat(station: Vec<&str>) -> WifiStationData {
}
"associated:" => {
let next_str = iter.next().unwrap();
if *next_str == "yes" {
ret.associated = true;
} else {
ret.associated = false;
}
ret.associated = *next_str == "yes";
}
"preamble:" => ret.preamble = iter.next().unwrap().to_string(),
"WMM/WME:" => {
let next_str = iter.next().unwrap();
if *next_str == "yes" {
ret.wmm_wme = true;
} else {
ret.wmm_wme = false;
}
ret.wmm_wme = *next_str == "yes";
}
"MFP:" => {
let next_str = iter.next().unwrap();
if *next_str == "yes" {
ret.mfp = true;
} else {
ret.mfp = false;
}
ret.mfp = *next_str == "yes";
}
"peer:" => {
let next_str = iter.next().unwrap();
if *next_str == "yes" {
ret.tdls_peer = true;
} else {
ret.tdls_peer = false;
}
ret.tdls_peer = *next_str == "yes";
}
"period:" => ret.dtim_period = iter.next().unwrap().parse::<u16>().unwrap_or(0u16),
"beacon" => {
Expand All @@ -266,11 +242,7 @@ fn get_struct_stat(station: Vec<&str>) -> WifiStationData {
}
"slot" => {
let next_str = *iter.next().unwrap();
if next_str.contains("yes") {
ret.short_slot_time = true;
} else {
ret.short_slot_time = false;
}
ret.short_slot_time = next_str.contains("yes");
}
"connected" => {
iter.next();
Expand Down
6 changes: 1 addition & 5 deletions rita_client/src/dashboard/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ pub async fn set_operator_fee(fee: Path<Uint256>) -> HttpResponse {
let mut rita_client = settings::get_rita_client();
rita_client.operator.operator_fee = op_fee;

if op_fee == 0_u8.into() {
rita_client.operator.use_operator_price = true
} else {
rita_client.operator.use_operator_price = false;
}
rita_client.operator.use_operator_price = op_fee == 0_u8.into();

settings::set_rita_client(rita_client);

Expand Down
2 changes: 1 addition & 1 deletion rita_common/src/network_monitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub struct NetworkInfo {

/// updates babel neighbors, babel routes, and rita neighbors for a NetworkInfo
pub fn update_network_info(msg: NetworkInfo) {
let mut network_monitor = &mut *(NETWORK_MONITOR.write().unwrap());
let network_monitor = &mut *(NETWORK_MONITOR.write().unwrap());
let babel_neighbors = &msg.babel_neighbors;
let babel_routes = &msg.babel_routes;
let rita_neighbors = &msg.rita_neighbors;
Expand Down

0 comments on commit d2c0ee7

Please sign in to comment.