rust: fix clippy lints for clippy::assign_op_pattern

pull/8073/head
Jason Ish 3 years ago committed by Victor Julien
parent c4034dafa1
commit 29a4a7fddc

@ -696,7 +696,7 @@ impl DCERPCState {
if retval == -1 {
return -1;
}
idx = retval + idx;
idx += retval;
}
let call_id = self.get_hdr_call_id().unwrap_or(0);
let mut tx = self.create_tx(call_id);
@ -941,7 +941,7 @@ impl DCERPCState {
if consumed < 2 {
consumed = 0;
} else {
consumed = consumed - 1;
consumed -= 1;
}
SCLogDebug!("DCERPC record NOT found");
return AppLayerResult::incomplete(consumed as u32, 2);

@ -79,7 +79,7 @@ fn match_backuuid(
}
}
let ctxid = tx.get_req_ctxid();
ret = ret & ((uuidentry.ctxid == ctxid) as u8);
ret &= (uuidentry.ctxid == ctxid) as u8;
if ret == 0 {
SCLogDebug!("CTX IDs/UUIDs do not match");
continue;

@ -135,7 +135,7 @@ fn http2_tx_get_next_priority(
if pos == nb {
return prio.weight as i32;
} else {
pos = pos + 1;
pos += 1;
}
}
HTTP2FrameTypeData::HEADERS(hd) => {
@ -143,7 +143,7 @@ fn http2_tx_get_next_priority(
if pos == nb {
return prio.weight as i32;
} else {
pos = pos + 1;
pos += 1;
}
}
}
@ -157,7 +157,7 @@ fn http2_tx_get_next_priority(
if pos == nb {
return prio.weight as i32;
} else {
pos = pos + 1;
pos += 1;
}
}
HTTP2FrameTypeData::HEADERS(hd) => {
@ -165,7 +165,7 @@ fn http2_tx_get_next_priority(
if pos == nb {
return prio.weight as i32;
} else {
pos = pos + 1;
pos += 1;
}
}
}
@ -195,7 +195,7 @@ fn http2_tx_get_next_window(
if pos == nb {
return wu.sizeinc as i32;
} else {
pos = pos + 1;
pos += 1;
}
}
_ => {}
@ -208,7 +208,7 @@ fn http2_tx_get_next_window(
if pos == nb {
return wu.sizeinc as i32;
} else {
pos = pos + 1;
pos += 1;
}
}
_ => {}
@ -382,7 +382,7 @@ pub unsafe extern "C" fn rs_http2_tx_get_header_name(
*buffer_len = value.len() as u32;
return 1;
} else {
pos = pos + blocks.len() as u32;
pos += blocks.len() as u32;
}
}
}
@ -396,7 +396,7 @@ pub unsafe extern "C" fn rs_http2_tx_get_header_name(
*buffer_len = value.len() as u32;
return 1;
} else {
pos = pos + blocks.len() as u32;
pos += blocks.len() as u32;
}
}
}
@ -830,7 +830,7 @@ pub unsafe extern "C" fn rs_http2_tx_get_header(
*buffer_len = value.len() as u32;
return 1;
} else {
pos = pos + blocks.len() as u32;
pos += blocks.len() as u32;
}
}
}
@ -847,7 +847,7 @@ pub unsafe extern "C" fn rs_http2_tx_get_header(
*buffer_len = value.len() as u32;
return 1;
} else {
pos = pos + blocks.len() as u32;
pos += blocks.len() as u32;
}
}
}

@ -185,7 +185,7 @@ impl MQTTState {
if self.transactions.len() > unsafe { MQTT_MAX_TX } {
let mut index = self.tx_index_completed;
for tx_old in &mut self.transactions.range_mut(self.tx_index_completed..) {
index = index + 1;
index += 1;
if !tx_old.complete {
tx_old.complete = true;
MQTTState::set_event(tx_old, MQTTEvent::TooManyTransactions);

@ -51,10 +51,10 @@ fn convert_varint(continued: Vec<u8>, last: u8) -> u32 {
let mut multiplier = 1u32;
let mut value = 0u32;
for val in &continued {
value = value + ((val & 127) as u32 * multiplier);
multiplier = multiplier * 128u32;
value += (val & 127) as u32 * multiplier;
multiplier *= 128u32;
}
value = value + ((last & 127) as u32 * multiplier);
value += (last & 127) as u32 * multiplier;
return value;
}

@ -903,7 +903,7 @@ fn add_up_data_size(columns: Vec<ColumnFieldValue>) -> u64 {
for field in columns {
// -1 value means data value is NULL, let's not add that up
if field.value_length > 0 {
data_size = data_size + field.value_length as u64;
data_size += field.value_length as u64;
}
}
data_size

@ -76,7 +76,7 @@ impl PgsqlTransaction {
}
pub fn incr_row_cnt(&mut self) {
self.data_row_cnt = self.data_row_cnt + 1;
self.data_row_cnt += 1;
}
pub fn get_row_cnt(&self) -> u16 {
@ -84,7 +84,7 @@ impl PgsqlTransaction {
}
pub fn sum_data_size(&mut self, row_size: u64) {
self.data_size = self.data_size + row_size;
self.data_size += row_size;
}
}
@ -194,7 +194,7 @@ impl PgsqlState {
// to avoid quadratic complexity
let mut index = self.tx_index_completed;
for tx_old in &mut self.transactions.range_mut(self.tx_index_completed..) {
index = index + 1;
index += 1;
if tx_old.tx_state < PgsqlTransactionState::ResponseDone {
tx_old.tx_state = PgsqlTransactionState::FlushedOut;
//TODO set event

@ -167,7 +167,7 @@ fn parse_padding_frame(input: &[u8]) -> IResult<&[u8], Frame, QuicError> {
if input[offset] != 0 {
break;
}
offset = offset + 1;
offset += 1;
}
return Ok((&input[offset..], Frame::Padding));
}

@ -356,7 +356,7 @@ fn smb_dcerpc_response_bindack(
}
ifaces[i].ack_result = r.ack_result;
ifaces[i].acked = true;
i = i + 1;
i += 1;
}
},
_ => {},

@ -1386,7 +1386,7 @@ impl SMBState {
if consumed < 4 {
consumed = 0;
} else {
consumed = consumed - 3;
consumed -= 3;
}
SCLogDebug!("smb record NOT found");
return AppLayerResult::incomplete(consumed as u32, 8);
@ -1718,7 +1718,7 @@ impl SMBState {
if consumed < 4 {
consumed = 0;
} else {
consumed = consumed - 3;
consumed -= 3;
}
SCLogDebug!("smb record NOT found");
return AppLayerResult::incomplete(consumed as u32, 8);

@ -439,7 +439,7 @@ pub fn smb2_request_record<'b>(state: &mut SMBState, r: &Smb2Record<'b>)
if guid_key.msg_id == 0 {
b"<unknown>".to_vec()
} else {
guid_key.msg_id = guid_key.msg_id - 1;
guid_key.msg_id -= 1;
match state.ssn2vec_map.get(&guid_key) {
Some(n) => { n.to_vec() },
None => { b"<unknown>".to_vec()},

@ -606,7 +606,7 @@ fn smb_basic_search(d: &[u8]) -> usize {
if window == needle {
return r;
}
r = r + 1;
r += 1;
}
return 0;
}

Loading…
Cancel
Save