rust/clippy: fix lint: extra_unused_lifetimes

pull/8251/head
Jason Ish 4 years ago committed by Victor Julien
parent 3044565cf4
commit f250b92180

@ -50,7 +50,7 @@ pub fn dns_parse_header(i: &[u8]) -> IResult<&[u8], DNSHeader> {
/// Parameters: /// Parameters:
/// start: the start of the name /// start: the start of the name
/// message: the complete message that start is a part of /// message: the complete message that start is a part of
pub fn dns_parse_name<'a, 'b>(start: &'b [u8], message: &'b [u8]) -> IResult<&'b [u8], Vec<u8>> { pub fn dns_parse_name<'b>(start: &'b [u8], message: &'b [u8]) -> IResult<&'b [u8], Vec<u8>> {
let mut pos = start; let mut pos = start;
let mut pivot = start; let mut pivot = start;
let mut name: Vec<u8> = Vec::with_capacity(32); let mut name: Vec<u8> = Vec::with_capacity(32);

@ -32,7 +32,6 @@
#![allow(clippy::collapsible_if)] #![allow(clippy::collapsible_if)]
#![allow(clippy::derive_partial_eq_without_eq)] #![allow(clippy::derive_partial_eq_without_eq)]
#![allow(clippy::explicit_counter_loop)] #![allow(clippy::explicit_counter_loop)]
#![allow(clippy::extra_unused_lifetimes)]
#![allow(clippy::field_reassign_with_default)] #![allow(clippy::field_reassign_with_default)]
#![allow(clippy::manual_find)] #![allow(clippy::manual_find)]
#![allow(clippy::match_like_matches_macro)] #![allow(clippy::match_like_matches_macro)]

@ -1113,7 +1113,7 @@ impl NFSState {
} }
} }
pub fn parse_tcp_data_ts_gap<'b>(&mut self, gap_size: u32) -> AppLayerResult { pub fn parse_tcp_data_ts_gap(&mut self, gap_size: u32) -> AppLayerResult {
SCLogDebug!("parse_tcp_data_ts_gap ({})", gap_size); SCLogDebug!("parse_tcp_data_ts_gap ({})", gap_size);
let gap = vec![0; gap_size as usize]; let gap = vec![0; gap_size as usize];
let consumed = self.filetracker_update(Direction::ToServer, &gap, gap_size); let consumed = self.filetracker_update(Direction::ToServer, &gap, gap_size);
@ -1127,7 +1127,7 @@ impl NFSState {
return AppLayerResult::ok(); return AppLayerResult::ok();
} }
pub fn parse_tcp_data_tc_gap<'b>(&mut self, gap_size: u32) -> AppLayerResult { pub fn parse_tcp_data_tc_gap(&mut self, gap_size: u32) -> AppLayerResult {
SCLogDebug!("parse_tcp_data_tc_gap ({})", gap_size); SCLogDebug!("parse_tcp_data_tc_gap ({})", gap_size);
let gap = vec![0; gap_size as usize]; let gap = vec![0; gap_size as usize];
let consumed = self.filetracker_update(Direction::ToClient, &gap, gap_size); let consumed = self.filetracker_update(Direction::ToClient, &gap, gap_size);
@ -1198,7 +1198,7 @@ impl NFSState {
} }
/// Parsing function, handling TCP chunks fragmentation /// Parsing function, handling TCP chunks fragmentation
pub fn parse_tcp_data_ts<'b>(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult { pub fn parse_tcp_data_ts(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult {
let mut cur_i = stream_slice.as_slice(); let mut cur_i = stream_slice.as_slice();
// take care of in progress file chunk transfers // take care of in progress file chunk transfers
// and skip buffer beyond it // and skip buffer beyond it
@ -1362,7 +1362,7 @@ impl NFSState {
} }
/// Parsing function, handling TCP chunks fragmentation /// Parsing function, handling TCP chunks fragmentation
pub fn parse_tcp_data_tc<'b>(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult { pub fn parse_tcp_data_tc(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult {
let mut cur_i = stream_slice.as_slice(); let mut cur_i = stream_slice.as_slice();
// take care of in progress file chunk transfers // take care of in progress file chunk transfers
// and skip buffer beyond it // and skip buffer beyond it
@ -1466,7 +1466,7 @@ impl NFSState {
AppLayerResult::ok() AppLayerResult::ok()
} }
/// Parsing function /// Parsing function
pub fn parse_udp_ts<'b>(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult { pub fn parse_udp_ts(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult {
let input = stream_slice.as_slice(); let input = stream_slice.as_slice();
SCLogDebug!("parse_udp_ts ({})", input.len()); SCLogDebug!("parse_udp_ts ({})", input.len());
self.add_rpc_udp_ts_pdu(flow, stream_slice, input, input.len() as i64); self.add_rpc_udp_ts_pdu(flow, stream_slice, input, input.len() as i64);
@ -1498,7 +1498,7 @@ impl NFSState {
} }
/// Parsing function /// Parsing function
pub fn parse_udp_tc<'b>(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult { pub fn parse_udp_tc(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult {
let input = stream_slice.as_slice(); let input = stream_slice.as_slice();
SCLogDebug!("parse_udp_tc ({})", input.len()); SCLogDebug!("parse_udp_tc ({})", input.len());
self.add_rpc_udp_tc_pdu(flow, stream_slice, input, input.len() as i64); self.add_rpc_udp_tc_pdu(flow, stream_slice, input, input.len() as i64);

@ -394,7 +394,7 @@ fn smb_read_dcerpc_record_error(state: &mut SMBState,
return found; return found;
} }
fn dcerpc_response_handle<'b>(tx: &mut SMBTransaction, fn dcerpc_response_handle(tx: &mut SMBTransaction,
vercmd: SMBVerCmdStat, vercmd: SMBVerCmdStat,
dcer: &DceRpcRecord) dcer: &DceRpcRecord)
{ {
@ -520,7 +520,7 @@ pub fn smb_read_dcerpc_record<'b>(state: &mut SMBState,
} }
/// Try to find out if the input data looks like DCERPC /// Try to find out if the input data looks like DCERPC
pub fn smb_dcerpc_probe<'b>(data: &[u8]) -> bool pub fn smb_dcerpc_probe(data: &[u8]) -> bool
{ {
if let Ok((_, recr)) = parse_dcerpc_record(data) { if let Ok((_, recr)) = parse_dcerpc_record(data) {
SCLogDebug!("SMB: could be DCERPC {:?}", recr); SCLogDebug!("SMB: could be DCERPC {:?}", recr);

@ -1316,7 +1316,7 @@ impl SMBState {
} }
/// Parsing function, handling TCP chunks fragmentation /// Parsing function, handling TCP chunks fragmentation
pub fn parse_tcp_data_ts<'b>(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult pub fn parse_tcp_data_ts(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult
{ {
let mut cur_i = stream_slice.as_slice(); let mut cur_i = stream_slice.as_slice();
let consumed = self.handle_skip(Direction::ToServer, cur_i.len() as u32); let consumed = self.handle_skip(Direction::ToServer, cur_i.len() as u32);
@ -1645,7 +1645,7 @@ impl SMBState {
} }
/// Parsing function, handling TCP chunks fragmentation /// Parsing function, handling TCP chunks fragmentation
pub fn parse_tcp_data_tc<'b>(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult pub fn parse_tcp_data_tc(&mut self, flow: *const Flow, stream_slice: &StreamSlice) -> AppLayerResult
{ {
let mut cur_i = stream_slice.as_slice(); let mut cur_i = stream_slice.as_slice();
let consumed = self.handle_skip(Direction::ToClient, cur_i.len() as u32); let consumed = self.handle_skip(Direction::ToClient, cur_i.len() as u32);

Loading…
Cancel
Save