error: unnecessary use of `to_vec`
--> src/smb/smb.rs:1048:62
|
1048 | let (name, is_dcerpc) = match self.guid2name_map.get(&guid.to_vec()) {
| ^^^^^^^^^^^^^^ help: replace it with: `guid`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[deny(clippy::unnecessary_to_owned)]` implied by `#[deny(warnings)]`
And also other uses of to_vec() on already Vec
js.set_uint("id", header.txid as u64)?;
js.set_string("client_mac",
- &format_addr_hex(&header.clienthw.to_vec()))?;
+ &format_addr_hex(&header.clienthw))?;
js.set_string("assigned_ip", &dns_print_addr(&header.yourip))?;
if self.extended {
pub fn get_service_for_guid(&self, guid: &[u8]) -> (&'static str, bool)
{
- let (name, is_dcerpc) = match self.guid2name_map.get(&guid.to_vec()) {
+ let (name, is_dcerpc) = match self.guid2name_map.get(guid) {
Some(n) => {
let mut s = n.as_slice();
// skip leading \ if we have it
state.ssn2vec_map.insert(name_key, name_val);
let tx_hdr = SMBCommonHdr::from1(r, SMBHDR_TYPE_GENERICTX);
- let tx = state.new_create_tx(&cr.file_name.to_vec(),
+ let tx = state.new_create_tx(&cr.file_name,
cr.disposition, del, dir, tx_hdr);
tx.vercmd.set_smb1_cmd(command);
SCLogDebug!("TS CREATE TX {} created", tx.id);