From: Juliana Fajardini Date: Fri, 29 Apr 2022 20:21:45 +0000 (-0300) Subject: pgsql: apply clippy fixes X-Git-Tag: suricata-7.0.0-beta1~670 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbd9a2ff1aafb7b453d256368405ea49b3dc4a32;p=thirdparty%2Fsuricata.git pgsql: apply clippy fixes --- diff --git a/rust/src/pgsql/pgsql.rs b/rust/src/pgsql/pgsql.rs index 84abec83da..a0bea1e596 100644 --- a/rust/src/pgsql/pgsql.rs +++ b/rust/src/pgsql/pgsql.rs @@ -522,8 +522,8 @@ pub unsafe extern "C" fn rs_pgsql_probing_parser_ts( _flow: *const Flow, _direction: u8, input: *const u8, input_len: u32, _rdir: *mut u8, ) -> AppProto { if input_len >= 1 && !input.is_null() { - let slice: &[u8]; - slice = build_slice!(input, input_len as usize); + + let slice: &[u8] = build_slice!(input, input_len as usize); if probe_ts(slice) { return ALPROTO_PGSQL; } @@ -537,8 +537,8 @@ pub unsafe extern "C" fn rs_pgsql_probing_parser_tc( _flow: *const Flow, _direction: u8, input: *const u8, input_len: u32, _rdir: *mut u8, ) -> AppProto { if input_len >= 1 && !input.is_null() { - let slice: &[u8]; - slice = build_slice!(input, input_len as usize); + + let slice: &[u8] = build_slice!(input, input_len as usize); if parser::parse_ssl_response(slice).is_ok() { return ALPROTO_PGSQL; @@ -597,8 +597,8 @@ pub unsafe extern "C" fn rs_pgsql_parse_request( } } - let state_safe: &mut PgsqlState; - state_safe = cast_pointer!(state, PgsqlState); + + let state_safe: &mut PgsqlState = cast_pointer!(state, PgsqlState); if stream_slice.is_gap() { state_safe.on_request_gap(stream_slice.gap_size()); @@ -618,8 +618,8 @@ pub unsafe extern "C" fn rs_pgsql_parse_response( } else { false }; - let state_safe: &mut PgsqlState; - state_safe = cast_pointer!(state, PgsqlState); + + let state_safe: &mut PgsqlState = cast_pointer!(state, PgsqlState); if stream_slice.is_gap() { state_safe.on_response_gap(stream_slice.gap_size());