From 60324740e65602bca31d76b8f8d247f900dba5aa Mon Sep 17 00:00:00 2001 From: Pierre Chifflier Date: Tue, 4 Dec 2018 17:40:28 +0100 Subject: [PATCH] SNMP: use explicit references to support build with old rust compiler --- rust/src/snmp/log.rs | 4 ++-- rust/src/snmp/snmp.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/src/snmp/log.rs b/rust/src/snmp/log.rs index 965816148e..d7efb8a37a 100644 --- a/rust/src/snmp/log.rs +++ b/rust/src/snmp/log.rs @@ -35,8 +35,8 @@ pub extern "C" fn rs_snmp_log_json_response(state: &mut SNMPState, tx: &mut SNMP if info.err.0 != 0 { js.set_string("error", &format!("{:?}", info.err)); } - match &info.trap_type { - Some((trap_type, oid, address)) => { + match info.trap_type { + Some((trap_type, ref oid, address)) => { js.set_string("trap_type", &format!("{:?}", trap_type)); js.set_string("trap_oid", &oid.to_string()); match address { diff --git a/rust/src/snmp/snmp.rs b/rust/src/snmp/snmp.rs index bab066ab19..b190351742 100644 --- a/rust/src/snmp/snmp.rs +++ b/rust/src/snmp/snmp.rs @@ -113,7 +113,7 @@ impl SNMPState { fn add_pdu_info(&mut self, pdu: &SnmpPdu, tx: &mut SNMPTransaction) { let mut pdu_info = SNMPPduInfo::default(); pdu_info.pdu_type = pdu.pdu_type(); - match pdu { + match *pdu { SnmpPdu::Generic(ref pdu) => { pdu_info.err = pdu.err; },