File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -261,12 +261,11 @@ pub enum AmountChange {
261
261
impl StateChange for AmountChange {
262
262
type State = Amount ;
263
263
264
- fn from_spent ( state : Self :: State ) -> Self { AmountChange :: Dec ( state. into ( ) ) }
264
+ fn from_spent ( state : Self :: State ) -> Self { AmountChange :: Dec ( state) }
265
265
266
- fn from_received ( state : Self :: State ) -> Self { AmountChange :: Inc ( state. into ( ) ) }
266
+ fn from_received ( state : Self :: State ) -> Self { AmountChange :: Inc ( state) }
267
267
268
- fn merge_spent ( & mut self , state : Self :: State ) {
269
- let sub = Amount :: from ( state) ;
268
+ fn merge_spent ( & mut self , sub : Self :: State ) {
270
269
* self = match self {
271
270
AmountChange :: Dec ( neg) => AmountChange :: Dec ( * neg + sub) ,
272
271
AmountChange :: Zero => AmountChange :: Dec ( sub) ,
@@ -277,8 +276,7 @@ impl StateChange for AmountChange {
277
276
} ;
278
277
}
279
278
280
- fn merge_received ( & mut self , state : Self :: State ) {
281
- let add = Amount :: from ( state) ;
279
+ fn merge_received ( & mut self , add : Self :: State ) {
282
280
* self = match self {
283
281
AmountChange :: Inc ( pos) => AmountChange :: Inc ( * pos + add) ,
284
282
AmountChange :: Zero => AmountChange :: Inc ( add) ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ use amplify::IoError;
23
23
use baid58:: Baid58ParseError ;
24
24
use strict_types:: { typesys, CompileError } ;
25
25
26
+ #[ allow( dead_code) ]
26
27
#[ derive( Debug , From ) ]
27
28
pub ( super ) enum Error {
28
29
#[ from( std:: io:: Error ) ]
You can’t perform that action at this time.
0 commit comments