@@ -124,11 +124,12 @@ mod client_edns {
124
124
match rdata {
125
125
Rdata :: OPT ( opt) => {
126
126
let options = opt. get_option ( ) ;
127
+ let first = options[ 0 ] . clone ( ) ;
128
+ if let OptionData :: NSID ( c) = first. get_opt_data ( ) {
129
+ assert ! ( c. starts_with( "gpdns" ) ) ;
130
+ assert_eq ! ( first. get_option_len( ) , 9 ) ;
131
+ }
127
132
128
- let mut first_expected = OptOption :: new ( OptionCode :: NSID ) ;
129
- first_expected. set_option_len ( 9 ) ;
130
- first_expected. set_opt_data ( OptionData :: from_bytes_with_opt_type ( "gpdns-scl" . to_string ( ) . into_bytes ( ) , OptionCode :: NSID ) . unwrap ( ) ) ;
131
- assert_eq ! ( options[ 0 ] , first_expected) ;
132
133
133
134
let mut second_expected = OptOption :: new ( OptionCode :: EDE ) ;
134
135
let mut expected_opt_data = EdeOptData :: new ( ) ;
@@ -189,10 +190,11 @@ mod client_edns {
189
190
Rdata :: OPT ( opt) => {
190
191
let options = opt. get_option ( ) ;
191
192
192
- let mut expected = OptOption :: new ( OptionCode :: NSID ) ;
193
- expected. set_opt_data ( OptionData :: from_bytes_with_opt_type ( "gpdns-scl" . to_string ( ) . into_bytes ( ) , OptionCode :: NSID ) . unwrap ( ) ) ;
194
- expected. set_option_len ( 9 ) ;
195
- assert_eq ! ( options[ 0 ] , expected) ;
193
+ let first = options[ 0 ] . clone ( ) ;
194
+ if let OptionData :: NSID ( c) = first. get_opt_data ( ) {
195
+ assert ! ( c. starts_with( "gpdns" ) ) ;
196
+ assert_eq ! ( first. get_option_len( ) , 9 ) ;
197
+ }
196
198
} ,
197
199
_ => { }
198
200
}
0 commit comments