@@ -49,15 +49,15 @@ impl<'v> PartialEq<bool> for Value<'v> {
4949 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
5050 #[ must_use]
5151 fn eq ( & self , other : & bool ) -> bool {
52- self . as_bool ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
52+ self . as_bool ( ) . is_some_and ( |t| t. eq ( other) )
5353 }
5454}
5555
5656impl < ' v > PartialEq < str > for Value < ' v > {
5757 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
5858 #[ must_use]
5959 fn eq ( & self , other : & str ) -> bool {
60- self . as_str ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
60+ self . as_str ( ) . is_some_and ( |t| t. eq ( other) )
6161 }
6262}
6363
@@ -73,111 +73,111 @@ impl<'v> PartialEq<String> for Value<'v> {
7373 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
7474 #[ must_use]
7575 fn eq ( & self , other : & String ) -> bool {
76- self . as_str ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
76+ self . as_str ( ) . is_some_and ( |t| t. eq ( other) )
7777 }
7878}
7979
8080impl < ' v > PartialEq < i8 > for Value < ' v > {
8181 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
8282 #[ must_use]
8383 fn eq ( & self , other : & i8 ) -> bool {
84- self . as_i8 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
84+ self . as_i8 ( ) . is_some_and ( |t| t. eq ( other) )
8585 }
8686}
8787
8888impl < ' v > PartialEq < i16 > for Value < ' v > {
8989 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
9090 #[ must_use]
9191 fn eq ( & self , other : & i16 ) -> bool {
92- self . as_i16 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
92+ self . as_i16 ( ) . is_some_and ( |t| t. eq ( other) )
9393 }
9494}
9595
9696impl < ' v > PartialEq < i32 > for Value < ' v > {
9797 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
9898 #[ must_use]
9999 fn eq ( & self , other : & i32 ) -> bool {
100- self . as_i32 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
100+ self . as_i32 ( ) . is_some_and ( |t| t. eq ( other) )
101101 }
102102}
103103
104104impl < ' v > PartialEq < i64 > for Value < ' v > {
105105 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
106106 #[ must_use]
107107 fn eq ( & self , other : & i64 ) -> bool {
108- self . as_i64 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
108+ self . as_i64 ( ) . is_some_and ( |t| t. eq ( other) )
109109 }
110110}
111111
112112impl < ' v > PartialEq < i128 > for Value < ' v > {
113113 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
114114 #[ must_use]
115115 fn eq ( & self , other : & i128 ) -> bool {
116- self . as_i128 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
116+ self . as_i128 ( ) . is_some_and ( |t| t. eq ( other) )
117117 }
118118}
119119
120120impl < ' v > PartialEq < u8 > for Value < ' v > {
121121 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
122122 #[ must_use]
123123 fn eq ( & self , other : & u8 ) -> bool {
124- self . as_u8 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
124+ self . as_u8 ( ) . is_some_and ( |t| t. eq ( other) )
125125 }
126126}
127127
128128impl < ' v > PartialEq < u16 > for Value < ' v > {
129129 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
130130 #[ must_use]
131131 fn eq ( & self , other : & u16 ) -> bool {
132- self . as_u16 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
132+ self . as_u16 ( ) . is_some_and ( |t| t. eq ( other) )
133133 }
134134}
135135
136136impl < ' v > PartialEq < u32 > for Value < ' v > {
137137 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
138138 #[ must_use]
139139 fn eq ( & self , other : & u32 ) -> bool {
140- self . as_u32 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
140+ self . as_u32 ( ) . is_some_and ( |t| t. eq ( other) )
141141 }
142142}
143143
144144impl < ' v > PartialEq < u64 > for Value < ' v > {
145145 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
146146 #[ must_use]
147147 fn eq ( & self , other : & u64 ) -> bool {
148- self . as_u64 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
148+ self . as_u64 ( ) . is_some_and ( |t| t. eq ( other) )
149149 }
150150}
151151
152152impl < ' v > PartialEq < usize > for Value < ' v > {
153153 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
154154 #[ must_use]
155155 fn eq ( & self , other : & usize ) -> bool {
156- self . as_usize ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
156+ self . as_usize ( ) . is_some_and ( |t| t. eq ( other) )
157157 }
158158}
159159
160160impl < ' v > PartialEq < u128 > for Value < ' v > {
161161 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
162162 #[ must_use]
163163 fn eq ( & self , other : & u128 ) -> bool {
164- self . as_u128 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
164+ self . as_u128 ( ) . is_some_and ( |t| t. eq ( other) )
165165 }
166166}
167167
168168impl < ' v > PartialEq < f32 > for Value < ' v > {
169169 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
170170 #[ must_use]
171171 fn eq ( & self , other : & f32 ) -> bool {
172- self . as_f32 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
172+ self . as_f32 ( ) . is_some_and ( |t| t. eq ( other) )
173173 }
174174}
175175
176176impl < ' v > PartialEq < f64 > for Value < ' v > {
177177 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
178178 #[ must_use]
179179 fn eq ( & self , other : & f64 ) -> bool {
180- self . as_f64 ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
180+ self . as_f64 ( ) . is_some_and ( |t| t. eq ( other) )
181181 }
182182}
183183
@@ -188,7 +188,7 @@ where
188188 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
189189 #[ must_use]
190190 fn eq ( & self , other : & & [ T ] ) -> bool {
191- self . as_array ( ) . map ( |t| t. eq ( other) ) . unwrap_or_default ( )
191+ self . as_array ( ) . is_some_and ( |t| t. eq ( other) )
192192 }
193193}
194194
0 commit comments