Skip to content

Commit

Permalink
Delete of useless .clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
Litr0 committed Nov 17, 2023
1 parent f85543b commit 2d34978
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/domain_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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(_) => {}
Expand Down
2 changes: 1 addition & 1 deletion src/message/resource_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,_)) => {
Expand Down

0 comments on commit 2d34978

Please sign in to comment.