@@ -89,9 +89,10 @@ pub trait Candidate: fmt::Display {
8989}
9090
9191/// Represents the type of candidate `CandidateType` enum.
92- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Serialize , Deserialize ) ]
92+ #[ derive( Default , Clone , Copy , Debug , PartialEq , Eq , Serialize , Deserialize ) ]
9393pub enum CandidateType {
9494 #[ serde( rename = "unspecified" ) ]
95+ #[ default]
9596 Unspecified ,
9697 #[ serde( rename = "host" ) ]
9798 Host ,
@@ -117,12 +118,6 @@ impl fmt::Display for CandidateType {
117118 }
118119}
119120
120- impl Default for CandidateType {
121- fn default ( ) -> Self {
122- Self :: Unspecified
123- }
124- }
125-
126121impl CandidateType {
127122 /// Returns the preference weight of a `CandidateType`.
128123 ///
@@ -171,9 +166,10 @@ impl fmt::Display for CandidateRelatedAddress {
171166}
172167
173168/// Represent the ICE candidate pair state.
174- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Serialize , Deserialize ) ]
169+ #[ derive( Default , Clone , Copy , Debug , PartialEq , Eq , Serialize , Deserialize ) ]
175170pub enum CandidatePairState {
176171 #[ serde( rename = "unspecified" ) ]
172+ #[ default]
177173 Unspecified = 0 ,
178174
179175 /// Means a check has not been performed for this pair.
@@ -206,12 +202,6 @@ impl From<u8> for CandidatePairState {
206202 }
207203}
208204
209- impl Default for CandidatePairState {
210- fn default ( ) -> Self {
211- Self :: Unspecified
212- }
213- }
214-
215205impl fmt:: Display for CandidatePairState {
216206 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
217207 let s = match * self {
0 commit comments