@@ -246,27 +246,26 @@ impl FullInt {
246
246
impl PartialEq for FullInt {
247
247
#[ must_use]
248
248
fn eq ( & self , other : & Self ) -> bool {
249
- self . partial_cmp ( other) . expect ( "`partial_cmp` only returns `Some(_)`" ) == Ordering :: Equal
249
+ self . cmp ( other) == Ordering :: Equal
250
250
}
251
251
}
252
252
253
253
impl PartialOrd for FullInt {
254
254
#[ must_use]
255
255
fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
256
- Some ( match ( self , other) {
257
- ( & Self :: S ( s) , & Self :: S ( o) ) => s. cmp ( & o) ,
258
- ( & Self :: U ( s) , & Self :: U ( o) ) => s. cmp ( & o) ,
259
- ( & Self :: S ( s) , & Self :: U ( o) ) => Self :: cmp_s_u ( s, o) ,
260
- ( & Self :: U ( s) , & Self :: S ( o) ) => Self :: cmp_s_u ( o, s) . reverse ( ) ,
261
- } )
256
+ Some ( self . cmp ( other) )
262
257
}
263
258
}
264
259
265
260
impl Ord for FullInt {
266
261
#[ must_use]
267
262
fn cmp ( & self , other : & Self ) -> Ordering {
268
- self . partial_cmp ( other)
269
- . expect ( "`partial_cmp` for FullInt can never return `None`" )
263
+ match ( self , other) {
264
+ ( & Self :: S ( s) , & Self :: S ( o) ) => s. cmp ( & o) ,
265
+ ( & Self :: U ( s) , & Self :: U ( o) ) => s. cmp ( & o) ,
266
+ ( & Self :: S ( s) , & Self :: U ( o) ) => Self :: cmp_s_u ( s, o) ,
267
+ ( & Self :: U ( s) , & Self :: S ( o) ) => Self :: cmp_s_u ( o, s) . reverse ( ) ,
268
+ }
270
269
}
271
270
}
272
271
0 commit comments