فهرست منبع

Remove some unnecessary Clone derives

Profiling reveals that removing these derives knocks off approximately 3.56 billion years from the compilation time.
Benjamin Sago 4 سال پیش
والد
کامیت
06201d6d0e

+ 1 - 1
dns/src/record/caa.rs

@@ -9,7 +9,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 6844](https://tools.ietf.org/html/rfc6844) — DNS Certification Authority Authorization Resource Record (January 2013)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct CAA {
 
     /// Whether this record is marked as “critical” or not.

+ 1 - 1
dns/src/record/cname.rs

@@ -9,7 +9,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 1035 §3.3.1](https://tools.ietf.org/html/rfc1035) — Domain Names, Implementation and Specification (November 1987)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct CNAME {
 
     /// The domain name that this CNAME record is responding with.

+ 1 - 1
dns/src/record/mod.rs

@@ -40,7 +40,7 @@ pub use self::others::{UnknownQtype, find_other_qtype_number};
 
 
 /// A record that’s been parsed from a byte buffer.
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub enum Record {
 
     /// An **A** record.

+ 1 - 1
dns/src/record/mx.rs

@@ -10,7 +10,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 1035 §3.3.s](https://tools.ietf.org/html/rfc1035) — Domain Names, Implementation and Specification (November 1987)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct MX {
 
     /// The preference that clients should give to this MX record amongst all

+ 1 - 1
dns/src/record/ns.rs

@@ -10,7 +10,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 1035 §3.3.11](https://tools.ietf.org/html/rfc1035) — Domain Names, Implementation and Specification (November 1987)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct NS {
 
     /// The address of a nameserver that provides this DNS response.

+ 1 - 1
dns/src/record/opt.rs

@@ -29,7 +29,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 6891](https://tools.ietf.org/html/rfc6891) — Extension Mechanisms for DNS (April 2013)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct OPT {
 
     /// The maximum size of a UDP packet that the client supports.

+ 1 - 1
dns/src/record/ptr.rs

@@ -15,7 +15,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 1035 §3.3.14](https://tools.ietf.org/html/rfc1035) — Domain Names, Implementation and Specification (November 1987)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct PTR {
 
     /// The CNAME contained in the record.

+ 1 - 1
dns/src/record/soa.rs

@@ -11,7 +11,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 1035 §3.3.13](https://tools.ietf.org/html/rfc1035) — Domain Names, Implementation and Specification (November 1987)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct SOA {
 
     /// The primary master name for this server.

+ 1 - 1
dns/src/record/srv.rs

@@ -10,7 +10,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 2782](https://tools.ietf.org/html/rfc2782) — A DNS RR for specifying the location of services (February 2000)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct SRV {
 
     /// The priority of this host among all that get returned. Lower values

+ 1 - 1
dns/src/record/txt.rs

@@ -13,7 +13,7 @@ use crate::wire::*;
 /// # References
 ///
 /// - [RFC 1035 §3.3.14](https://tools.ietf.org/html/rfc1035) — Domain Names, Implementation and Specification (November 1987)
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct TXT {
 
     /// The message contained in the record.

+ 4 - 4
dns/src/types.rs

@@ -8,7 +8,7 @@ use crate::strings::Labels;
 
 
 /// A request that gets sent out over a transport.
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct Request {
 
     /// The transaction ID of this request. This is used to make sure
@@ -29,7 +29,7 @@ pub struct Request {
 
 
 /// A response obtained from a DNS server.
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct Response {
 
     /// The transaction ID, which should match the ID of the request.
@@ -53,7 +53,7 @@ pub struct Response {
 
 
 /// A DNS query section.
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub struct Query {
 
     /// The domain name being queried, in human-readable dotted notation.
@@ -68,7 +68,7 @@ pub struct Query {
 
 
 /// A DNS answer section.
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Debug)]
 pub enum Answer {
 
     /// This is a standard answer with every field.