@@ -246,27 +246,26 @@ impl FullInt {
246246impl PartialEq for FullInt {
247247 #[ must_use]
248248 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
250250 }
251251}
252252
253253impl PartialOrd for FullInt {
254254 #[ must_use]
255255 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) )
262257 }
263258}
264259
265260impl Ord for FullInt {
266261 #[ must_use]
267262 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+ }
270269 }
271270}
272271
0 commit comments