From 2d34978e68ccb80f883badb3a5e11e7d12c8785a Mon Sep 17 00:00:00 2001 From: Litr0 Date: Fri, 17 Nov 2023 17:40:30 -0300 Subject: [PATCH] Delete of useless .clone() --- src/domain_name.rs | 4 ++-- src/message/resource_record.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/domain_name.rs b/src/domain_name.rs index 98c18775..6b88a426 100644 --- a/src/domain_name.rs +++ b/src/domain_name.rs @@ -69,7 +69,7 @@ impl DomainName { ) -> Result<(Self, &'a [u8]), &'static str> { let mut first_byte = bytes[0].clone(); let mut domain_name_str = "".to_string(); - let mut no_domain_bytes = bytes.clone(); + let mut no_domain_bytes = bytes; while first_byte != 0 { let bytes_len = no_domain_bytes.len(); @@ -85,7 +85,7 @@ impl DomainName { & 0b0011111111111111) as usize; let domain_name_result = - DomainName::from_bytes(&full_msg[offset..], full_msg.clone()); + DomainName::from_bytes(&full_msg[offset..], full_msg); match domain_name_result { Ok(_) => {} diff --git a/src/message/resource_record.rs b/src/message/resource_record.rs index f5440fd3..6d502f0d 100644 --- a/src/message/resource_record.rs +++ b/src/message/resource_record.rs @@ -182,7 +182,7 @@ impl ResourceRecord { bytes: &'a [u8], full_msg: &'a [u8], ) -> Result<(ResourceRecord, &'a [u8]), &'static str> { - let domain_name_result = DomainName::from_bytes(bytes, full_msg.clone()); + let domain_name_result = DomainName::from_bytes(bytes, full_msg); match domain_name_result.clone() { Ok((domain_name,_)) => {