From b6cc0e25b18c8ccc553857b1bc27839d52dfffac Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 5 Oct 2022 09:06:01 -0600 Subject: [PATCH] rust: fix clippy lints for clippy::redundant_static_lifetimes --- rust/src/applayertemplate/template.rs | 2 +- rust/src/dcerpc/dcerpc.rs | 2 +- rust/src/dhcp/dhcp.rs | 2 +- rust/src/http2/http2.rs | 2 +- rust/src/ike/ike.rs | 4 ++-- rust/src/krb/krb5.rs | 2 +- rust/src/mqtt/mqtt.rs | 2 +- rust/src/nfs/nfs.rs | 2 +- rust/src/ntp/ntp.rs | 2 +- rust/src/pgsql/pgsql.rs | 2 +- rust/src/rdp/rdp.rs | 2 +- rust/src/rfb/rfb.rs | 2 +- rust/src/sip/sip.rs | 2 +- rust/src/smb/smb.rs | 2 +- rust/src/snmp/snmp.rs | 2 +- rust/src/ssh/ssh.rs | 2 +- rust/src/telnet/telnet.rs | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rust/src/applayertemplate/template.rs b/rust/src/applayertemplate/template.rs index 321d321876..a7a962b567 100644 --- a/rust/src/applayertemplate/template.rs +++ b/rust/src/applayertemplate/template.rs @@ -420,7 +420,7 @@ export_tx_data_get!(rs_template_get_tx_data, TemplateTransaction); export_state_data_get!(rs_template_get_state_data, TemplateState); // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"template-rust\0"; +const PARSER_NAME: &[u8] = b"template-rust\0"; #[no_mangle] pub unsafe extern "C" fn rs_template_register_parser() { diff --git a/rust/src/dcerpc/dcerpc.rs b/rust/src/dcerpc/dcerpc.rs index eed4408b57..5f1a0cc49e 100644 --- a/rust/src/dcerpc/dcerpc.rs +++ b/rust/src/dcerpc/dcerpc.rs @@ -1341,7 +1341,7 @@ fn register_pattern_probe() -> i8 { export_state_data_get!(rs_dcerpc_get_state_data, DCERPCState); // Parser name as a C style string. -pub const PARSER_NAME: &'static [u8] = b"dcerpc\0"; +pub const PARSER_NAME: &[u8] = b"dcerpc\0"; #[no_mangle] pub unsafe extern "C" fn rs_dcerpc_register_parser() { diff --git a/rust/src/dhcp/dhcp.rs b/rust/src/dhcp/dhcp.rs index 407a5c47ad..48d737584d 100644 --- a/rust/src/dhcp/dhcp.rs +++ b/rust/src/dhcp/dhcp.rs @@ -268,7 +268,7 @@ pub unsafe extern "C" fn rs_dhcp_state_free(state: *mut std::os::raw::c_void) { export_tx_data_get!(rs_dhcp_get_tx_data, DHCPTransaction); export_state_data_get!(rs_dhcp_get_state_data, DHCPState); -const PARSER_NAME: &'static [u8] = b"dhcp\0"; +const PARSER_NAME: &[u8] = b"dhcp\0"; #[no_mangle] pub unsafe extern "C" fn rs_dhcp_register_parser() { diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index ffc4ffae9d..a8d9fbfb42 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -1201,7 +1201,7 @@ pub unsafe extern "C" fn rs_http2_getfiles( } // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"http2\0"; +const PARSER_NAME: &[u8] = b"http2\0"; #[no_mangle] pub unsafe extern "C" fn rs_http2_register_parser() { diff --git a/rust/src/ike/ike.rs b/rust/src/ike/ike.rs index 534c1232b4..8064df4709 100644 --- a/rust/src/ike/ike.rs +++ b/rust/src/ike/ike.rs @@ -391,8 +391,8 @@ pub unsafe extern "C" fn rs_ike_tx_set_logged( static mut ALPROTO_IKE: AppProto = ALPROTO_UNKNOWN; // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"ike\0"; -const PARSER_ALIAS: &'static [u8] = b"ikev2\0"; +const PARSER_NAME: &[u8] = b"ike\0"; +const PARSER_ALIAS: &[u8] = b"ikev2\0"; export_tx_data_get!(rs_ike_get_tx_data, IKETransaction); export_state_data_get!(rs_ike_get_state_data, IKEState); diff --git a/rust/src/krb/krb5.rs b/rust/src/krb/krb5.rs index 3370502b23..bdd54d202f 100644 --- a/rust/src/krb/krb5.rs +++ b/rust/src/krb/krb5.rs @@ -530,7 +530,7 @@ pub unsafe extern "C" fn rs_krb5_parse_response_tcp(_flow: *const core::Flow, export_tx_data_get!(rs_krb5_get_tx_data, KRB5Transaction); export_state_data_get!(rs_krb5_get_state_data, KRB5State); -const PARSER_NAME : &'static [u8] = b"krb5\0"; +const PARSER_NAME : &[u8] = b"krb5\0"; #[no_mangle] pub unsafe extern "C" fn rs_register_krb5_parser() { diff --git a/rust/src/mqtt/mqtt.rs b/rust/src/mqtt/mqtt.rs index 9dfef0cfe3..0f85b27653 100644 --- a/rust/src/mqtt/mqtt.rs +++ b/rust/src/mqtt/mqtt.rs @@ -721,7 +721,7 @@ pub unsafe extern "C" fn rs_mqtt_tx_set_logged( } // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"mqtt\0"; +const PARSER_NAME: &[u8] = b"mqtt\0"; export_tx_data_get!(rs_mqtt_get_tx_data, MQTTTransaction); export_state_data_get!(rs_mqtt_get_state_data, MQTTState); diff --git a/rust/src/nfs/nfs.rs b/rust/src/nfs/nfs.rs index e0c2c0cad6..06bdaa7b70 100644 --- a/rust/src/nfs/nfs.rs +++ b/rust/src/nfs/nfs.rs @@ -1935,7 +1935,7 @@ pub unsafe extern "C" fn rs_nfs_probe_udp_tc(_f: *const Flow, } // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"nfs\0"; +const PARSER_NAME: &[u8] = b"nfs\0"; #[no_mangle] pub unsafe extern "C" fn rs_nfs_register_parser() { diff --git a/rust/src/ntp/ntp.rs b/rust/src/ntp/ntp.rs index 63cb0bb751..f6514f4cbe 100644 --- a/rust/src/ntp/ntp.rs +++ b/rust/src/ntp/ntp.rs @@ -268,7 +268,7 @@ pub extern "C" fn ntp_probing_parser(_flow: *const Flow, export_tx_data_get!(rs_ntp_get_tx_data, NTPTransaction); export_state_data_get!(rs_ntp_get_state_data, NTPState); -const PARSER_NAME : &'static [u8] = b"ntp\0"; +const PARSER_NAME : &[u8] = b"ntp\0"; #[no_mangle] pub unsafe extern "C" fn rs_register_ntp_parser() { diff --git a/rust/src/pgsql/pgsql.rs b/rust/src/pgsql/pgsql.rs index e5058fc1ef..b6ed75b31c 100644 --- a/rust/src/pgsql/pgsql.rs +++ b/rust/src/pgsql/pgsql.rs @@ -697,7 +697,7 @@ export_tx_data_get!(rs_pgsql_get_tx_data, PgsqlTransaction); export_state_data_get!(rs_pgsql_get_state_data, PgsqlState); // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"pgsql\0"; +const PARSER_NAME: &[u8] = b"pgsql\0"; #[no_mangle] pub unsafe extern "C" fn rs_pgsql_register_parser() { diff --git a/rust/src/rdp/rdp.rs b/rust/src/rdp/rdp.rs index c150d11839..d48757b221 100644 --- a/rust/src/rdp/rdp.rs +++ b/rust/src/rdp/rdp.rs @@ -457,7 +457,7 @@ export_state_data_get!(rs_rdp_get_state_data, RdpState); // registration // -const PARSER_NAME: &'static [u8] = b"rdp\0"; +const PARSER_NAME: &[u8] = b"rdp\0"; #[no_mangle] pub unsafe extern "C" fn rs_rdp_register_parser() { diff --git a/rust/src/rfb/rfb.rs b/rust/src/rfb/rfb.rs index b17afba397..e579edadb1 100644 --- a/rust/src/rfb/rfb.rs +++ b/rust/src/rfb/rfb.rs @@ -569,7 +569,7 @@ pub unsafe extern "C" fn rs_rfb_tx_get_alstate_progress( } // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"rfb\0"; +const PARSER_NAME: &[u8] = b"rfb\0"; export_tx_data_get!(rs_rfb_get_tx_data, RFBTransaction); export_state_data_get!(rs_rfb_get_state_data, RFBState); diff --git a/rust/src/sip/sip.rs b/rust/src/sip/sip.rs index cb2bf03556..ff4d01200c 100755 --- a/rust/src/sip/sip.rs +++ b/rust/src/sip/sip.rs @@ -343,7 +343,7 @@ pub unsafe extern "C" fn rs_sip_parse_response( export_tx_data_get!(rs_sip_get_tx_data, SIPTransaction); export_state_data_get!(rs_sip_get_state_data, SIPState); -const PARSER_NAME: &'static [u8] = b"sip\0"; +const PARSER_NAME: &[u8] = b"sip\0"; #[no_mangle] pub unsafe extern "C" fn rs_sip_register_parser() { diff --git a/rust/src/smb/smb.rs b/rust/src/smb/smb.rs index a7c9db9e39..ddb2bb3a8f 100644 --- a/rust/src/smb/smb.rs +++ b/rust/src/smb/smb.rs @@ -2309,7 +2309,7 @@ fn register_pattern_probe() -> i8 { } // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"smb\0"; +const PARSER_NAME: &[u8] = b"smb\0"; #[no_mangle] pub unsafe extern "C" fn rs_smb_register_parser() { diff --git a/rust/src/snmp/snmp.rs b/rust/src/snmp/snmp.rs index 2344acedaf..c5d2698e91 100644 --- a/rust/src/snmp/snmp.rs +++ b/rust/src/snmp/snmp.rs @@ -372,7 +372,7 @@ pub unsafe extern "C" fn rs_snmp_probing_parser(_flow: *const Flow, export_tx_data_get!(rs_snmp_get_tx_data, SNMPTransaction); export_state_data_get!(rs_snmp_get_state_data, SNMPState); -const PARSER_NAME : &'static [u8] = b"snmp\0"; +const PARSER_NAME : &[u8] = b"snmp\0"; #[no_mangle] pub unsafe extern "C" fn rs_register_snmp_parser() { diff --git a/rust/src/ssh/ssh.rs b/rust/src/ssh/ssh.rs index 0a36f81666..95564a0a0b 100644 --- a/rust/src/ssh/ssh.rs +++ b/rust/src/ssh/ssh.rs @@ -434,7 +434,7 @@ pub unsafe extern "C" fn rs_ssh_tx_get_alstate_progress( } // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"ssh\0"; +const PARSER_NAME: &[u8] = b"ssh\0"; #[no_mangle] pub unsafe extern "C" fn rs_ssh_register_parser() { diff --git a/rust/src/telnet/telnet.rs b/rust/src/telnet/telnet.rs index 8f1c5dea71..b9102cc682 100644 --- a/rust/src/telnet/telnet.rs +++ b/rust/src/telnet/telnet.rs @@ -515,7 +515,7 @@ export_tx_data_get!(rs_telnet_get_tx_data, TelnetTransaction); export_state_data_get!(rs_telnet_get_state_data, TelnetState); // Parser name as a C style string. -const PARSER_NAME: &'static [u8] = b"telnet\0"; +const PARSER_NAME: &[u8] = b"telnet\0"; #[no_mangle] pub unsafe extern "C" fn rs_telnet_register_parser() {