@@ -467,49 +467,46 @@ pub trait CheckedSub<Rhs = Self>: Sized {
467
467
fn checked_sub ( & self , rhs : & Rhs ) -> CtOption < Self > ;
468
468
}
469
469
470
- /// Concatenate two numbers into a "wide" double-width value, using the `lo`
471
- /// value as the least significant value.
470
+ /// Concatenate two numbers into a "wide" double-width value, using the `hi` value as the most
471
+ /// significant portion of the resulting value.
472
472
pub trait Concat : ConcatMixed < Self , MixedOutput = Self :: Output > {
473
473
/// Concatenated output: twice the width of `Self`.
474
474
type Output : Integer ;
475
475
476
- /// Concatenate the two halves, with `self` as most significant and `lo`
477
- /// as the least significant.
478
- fn concat ( & self , lo : & Self ) -> Self :: Output {
479
- self . concat_mixed ( lo )
476
+ /// Concatenate the two halves, with `self` as least significant and `hi` as the least
477
+ /// significant.
478
+ fn concat ( & self , hi : & Self ) -> Self :: Output {
479
+ self . concat_mixed ( hi )
480
480
}
481
481
}
482
482
483
- /// Concatenate two numbers into a "wide" combined-width value, using the `lo`
484
- /// value as the least significant value.
485
- pub trait ConcatMixed < Lo : ?Sized = Self > {
486
- /// Concatenated output: combination of `Lo ` and `Self `.
483
+ /// Concatenate two numbers into a "wide" combined-width value, using the `hi` value as the most
484
+ /// significant value.
485
+ pub trait ConcatMixed < Hi : ?Sized = Self > {
486
+ /// Concatenated output: combination of `Self ` and `Hi `.
487
487
type MixedOutput : Integer ;
488
488
489
- /// Concatenate the two values, with `self` as most significant and `lo`
490
- /// as the least significant.
491
- fn concat_mixed ( & self , lo : & Lo ) -> Self :: MixedOutput ;
489
+ /// Concatenate the two values, with `self` as least significant and `hi` as the most
490
+ /// significant.
491
+ fn concat_mixed ( & self , hi : & Hi ) -> Self :: MixedOutput ;
492
492
}
493
493
494
- /// Split a number in half, returning the most significant half followed by
495
- /// the least significant.
494
+ /// Split a number in half, returning the least significant half followed by the most significant.
496
495
pub trait Split : SplitMixed < Self :: Output , Self :: Output > {
497
- /// Split output: high/ low components of the value.
496
+ /// Split output: low/high components of the value.
498
497
type Output ;
499
498
500
- /// Split this number in half, returning its high and low components
501
- /// respectively.
499
+ /// Split this number in half, returning its low and high components respectively.
502
500
fn split ( & self ) -> ( Self :: Output , Self :: Output ) {
503
501
self . split_mixed ( )
504
502
}
505
503
}
506
504
507
- /// Split a number into parts, returning the most significant part followed by
508
- /// the least significant.
509
- pub trait SplitMixed < Hi , Lo > {
510
- /// Split this number into parts, returning its high and low components
511
- /// respectively.
512
- fn split_mixed ( & self ) -> ( Hi , Lo ) ;
505
+ /// Split a number into parts, returning the least significant part followed by the most
506
+ /// significant.
507
+ pub trait SplitMixed < Lo , Hi > {
508
+ /// Split this number into parts, returning its low and high components respectively.
509
+ fn split_mixed ( & self ) -> ( Lo , Hi ) ;
513
510
}
514
511
515
512
/// Encoding support.
0 commit comments