File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to
10
10
11
11
- cosmwasm-std: Add an IBC querier implementation to ` testing::MockQuerier `
12
12
([ #1620 ] , [ #1624 ] ).
13
+ - cosmwasm-std: Add ` #[must_use] ` annotations to ` Timestamp ` math functions.
13
14
14
15
[ #1620 ] : https://github.com/CosmWasm/cosmwasm/pull/1620
15
16
[ #1624 ] : https://github.com/CosmWasm/cosmwasm/pull/1624
Original file line number Diff line number Diff line change @@ -38,19 +38,23 @@ impl Timestamp {
38
38
Timestamp ( Uint64 :: new ( seconds_since_epoch * 1_000_000_000 ) )
39
39
}
40
40
41
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
41
42
pub const fn plus_seconds ( & self , addition : u64 ) -> Timestamp {
42
43
self . plus_nanos ( addition * 1_000_000_000 )
43
44
}
44
45
46
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
45
47
pub const fn plus_nanos ( & self , addition : u64 ) -> Timestamp {
46
48
let nanos = Uint64 :: new ( self . 0 . u64 ( ) + addition) ;
47
49
Timestamp ( nanos)
48
50
}
49
51
52
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
50
53
pub const fn minus_seconds ( & self , subtrahend : u64 ) -> Timestamp {
51
54
self . minus_nanos ( subtrahend * 1_000_000_000 )
52
55
}
53
56
57
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
54
58
pub const fn minus_nanos ( & self , subtrahend : u64 ) -> Timestamp {
55
59
let nanos = Uint64 :: new ( self . 0 . u64 ( ) - subtrahend) ;
56
60
Timestamp ( nanos)
You can’t perform that action at this time.
0 commit comments