File tree Expand file tree Collapse file tree 12 files changed +14
-0
lines changed Expand file tree Collapse file tree 12 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ impl Decimal {
53
53
/// assert_eq!(value.to_string(), "141183460469231731687.303715884105727125");
54
54
/// ```
55
55
#[ inline]
56
+ #[ must_use]
56
57
pub const fn new ( value : Uint128 ) -> Self {
57
58
Self ( value)
58
59
}
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ impl Decimal256 {
58
58
/// assert_eq!(value.to_string(), "141183460469231731687.303715884105727125");
59
59
/// ```
60
60
#[ inline]
61
+ #[ must_use]
61
62
pub const fn new ( value : Uint256 ) -> Self {
62
63
Self ( value)
63
64
}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ impl Int128 {
47
47
///
48
48
/// This method is less flexible than `from` but can be called in a const context.
49
49
#[ inline]
50
+ #[ must_use]
50
51
pub const fn new ( value : i128 ) -> Self {
51
52
Self ( value)
52
53
}
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ impl Int256 {
64
64
///
65
65
/// [`from_be_bytes`]: Self::from_be_bytes
66
66
#[ inline]
67
+ #[ must_use]
67
68
pub const fn new ( value : i128 ) -> Self {
68
69
Self :: from_be_bytes ( grow_be_int ( value. to_be_bytes ( ) ) )
69
70
}
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ impl Int512 {
65
65
///
66
66
/// [`from_be_bytes`]: Self::from_be_bytes
67
67
#[ inline]
68
+ #[ must_use]
68
69
pub const fn new ( value : i128 ) -> Self {
69
70
Self :: from_be_bytes ( grow_be_int ( value. to_be_bytes ( ) ) )
70
71
}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ impl Int64 {
47
47
///
48
48
/// This method is less flexible than `from` but can be called in a const context.
49
49
#[ inline]
50
+ #[ must_use]
50
51
pub const fn new ( value : i64 ) -> Self {
51
52
Self ( value)
52
53
}
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ impl SignedDecimal {
73
73
/// assert_eq!(value.to_string(), "-141183460469231731687.303715884105727125");
74
74
/// ```
75
75
#[ inline]
76
+ #[ must_use]
76
77
pub const fn new ( value : Int128 ) -> Self {
77
78
Self ( value)
78
79
}
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ impl SignedDecimal256 {
85
85
/// assert_eq!(value.to_string(), "-141183460469231731687.303715884105727125");
86
86
/// ```
87
87
#[ inline]
88
+ #[ must_use]
88
89
pub const fn new ( value : Int256 ) -> Self {
89
90
Self ( value)
90
91
}
Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ impl Uint128 {
54
54
/// Creates a Uint128(value).
55
55
///
56
56
/// This method is less flexible than `from` but can be called in a const context.
57
+ #[ inline]
58
+ #[ must_use]
57
59
pub const fn new ( value : u128 ) -> Self {
58
60
Uint128 ( value)
59
61
}
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ impl Uint256 {
64
64
/// with [`from_be_bytes`].
65
65
///
66
66
/// [`from_be_bytes`]: Self::from_be_bytes
67
+ #[ must_use]
67
68
pub const fn new ( value : u128 ) -> Self {
68
69
let b = value. to_be_bytes ( ) ;
69
70
Self :: from_be_bytes ( [
You can’t perform that action at this time.
0 commit comments