rust: fix clippy lint for explicit_auto_deref

This adds unnecessary complexity to code.
pull/7966/head
Jason Ish 2 years ago committed by Victor Julien
parent c503ca62e2
commit 7d623f0854

@ -57,7 +57,7 @@ impl std::str::FromStr for HTTP2FrameType {
fn from_str(s: &str) -> Result<Self, Self::Err> {
let su = s.to_uppercase();
let su_slice: &str = &*su;
let su_slice: &str = &su;
match su_slice {
"DATA" => Ok(HTTP2FrameType::DATA),
"HEADERS" => Ok(HTTP2FrameType::HEADERS),
@ -132,7 +132,7 @@ impl std::str::FromStr for HTTP2ErrorCode {
fn from_str(s: &str) -> Result<Self, Self::Err> {
let su = s.to_uppercase();
let su_slice: &str = &*su;
let su_slice: &str = &su;
match su_slice {
"NO_ERROR" => Ok(HTTP2ErrorCode::NOERROR),
"PROTOCOL_ERROR" => Ok(HTTP2ErrorCode::PROTOCOLERROR),
@ -702,7 +702,7 @@ impl std::str::FromStr for HTTP2SettingsId {
fn from_str(s: &str) -> Result<Self, Self::Err> {
let su = s.to_uppercase();
let su_slice: &str = &*su;
let su_slice: &str = &su;
match su_slice {
"SETTINGS_HEADER_TABLE_SIZE" => Ok(HTTP2SettingsId::SETTINGSHEADERTABLESIZE),
"SETTINGS_ENABLE_PUSH" => Ok(HTTP2SettingsId::SETTINGSENABLEPUSH),

@ -309,9 +309,9 @@ impl MQTTState {
}
MQTTOperation::CONNACK(ref _connack) => {
if let Some(tx) = self.get_tx_by_pkt_id(MQTT_CONNECT_PKT_ID) {
(*tx).msg.push(msg);
(*tx).complete = true;
(*tx).pkt_id = None;
tx.msg.push(msg);
tx.complete = true;
tx.pkt_id = None;
self.connected = true;
} else {
let mut tx = self.new_tx(msg, toclient);
@ -327,7 +327,7 @@ impl MQTTState {
return;
}
if let Some(tx) = self.get_tx_by_pkt_id(v.message_id as u32) {
(*tx).msg.push(msg);
tx.msg.push(msg);
} else {
let mut tx = self.new_tx(msg, toclient);
MQTTState::set_event(&mut tx, MQTTEvent::MissingPublish);
@ -342,9 +342,9 @@ impl MQTTState {
return;
}
if let Some(tx) = self.get_tx_by_pkt_id(v.message_id as u32) {
(*tx).msg.push(msg);
(*tx).complete = true;
(*tx).pkt_id = None;
tx.msg.push(msg);
tx.complete = true;
tx.pkt_id = None;
} else {
let mut tx = self.new_tx(msg, toclient);
MQTTState::set_event(&mut tx, MQTTEvent::MissingPublish);
@ -359,9 +359,9 @@ impl MQTTState {
return;
}
if let Some(tx) = self.get_tx_by_pkt_id(suback.message_id as u32) {
(*tx).msg.push(msg);
(*tx).complete = true;
(*tx).pkt_id = None;
tx.msg.push(msg);
tx.complete = true;
tx.pkt_id = None;
} else {
let mut tx = self.new_tx(msg, toclient);
MQTTState::set_event(&mut tx, MQTTEvent::MissingSubscribe);
@ -376,9 +376,9 @@ impl MQTTState {
return;
}
if let Some(tx) = self.get_tx_by_pkt_id(unsuback.message_id as u32) {
(*tx).msg.push(msg);
(*tx).complete = true;
(*tx).pkt_id = None;
tx.msg.push(msg);
tx.complete = true;
tx.pkt_id = None;
} else {
let mut tx = self.new_tx(msg, toclient);
MQTTState::set_event(&mut tx, MQTTEvent::MissingUnsubscribe);

@ -88,7 +88,7 @@ impl std::str::FromStr for MQTTTypeCode {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let su = s.to_uppercase();
let su_slice: &str = &*su;
let su_slice: &str = &su;
match su_slice {
"CONNECT" => Ok(MQTTTypeCode::CONNECT),
"CONNACK" => Ok(MQTTTypeCode::CONNACK),

Loading…
Cancel
Save