File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -410,9 +410,9 @@ impl DeviceExt for Device {
410
410
. enumerate ( )
411
411
. find ( |( _, f) | f. name == pnew)
412
412
. ok_or_else ( || anyhow ! ( "peripheral {pnew} not found" ) ) ?;
413
- d. name = new. name . clone ( ) ;
413
+ d. name . clone_from ( & new. name ) ;
414
414
d. base_address = new. base_address ;
415
- d. interrupt = new. interrupt . clone ( ) ;
415
+ d. interrupt . clone_from ( & new. interrupt ) ;
416
416
* new = d;
417
417
for ( i, p) in self . peripherals . iter_mut ( ) . enumerate ( ) {
418
418
if p. derived_from . as_deref ( ) == Some ( pold) {
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ pub(crate) trait RegisterBlockExt: Name {
132
132
fn get_mut_reg ( & mut self , name : & str ) -> Option < & mut Register > ;
133
133
134
134
/// Register/cluster block
135
+ #[ allow( unused) ]
135
136
fn children ( & self ) -> Option < & Vec < RegisterCluster > > ;
136
137
137
138
/// Register/cluster block
@@ -402,6 +403,7 @@ pub(crate) trait RegisterBlockExt: Name {
402
403
}
403
404
}
404
405
/// Work through a register, handling all fields
406
+ #[ allow( unused) ]
405
407
fn process_register (
406
408
& mut self ,
407
409
rspec : & str ,
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ impl RegisterExt for Register {
389
389
for f in fields. iter_mut ( ) {
390
390
if names. contains ( & f. name ) {
391
391
if first {
392
- desc = f. description . clone ( ) ;
392
+ desc. clone_from ( & f. description ) ;
393
393
first = false ;
394
394
}
395
395
bitwidth += f. bit_range . width ;
You can’t perform that action at this time.
0 commit comments