File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 44
44
- id : codespell
45
45
args : [--ignore-words=.codespellignore]
46
46
- repo : https://github.com/sirosen/check-jsonschema
47
- rev : 0.31.3
47
+ rev : 0.33.0
48
48
hooks :
49
49
- id : check-github-actions
50
50
- id : check-github-workflows
Original file line number Diff line number Diff line change @@ -490,7 +490,7 @@ fn coil_to_bool(coil: u16) -> io::Result<bool> {
490
490
491
491
#[ cfg( any( test, feature = "rtu" , feature = "tcp" ) ) ]
492
492
fn packed_coils_size ( coils : & [ Coil ] ) -> usize {
493
- ( coils. len ( ) + 7 ) / 8
493
+ coils. len ( ) . div_ceil ( 8 )
494
494
}
495
495
496
496
#[ cfg( any( test, feature = "rtu" , feature = "tcp" ) ) ]
@@ -552,9 +552,9 @@ fn response_pdu_size(response: &Response) -> io::Result<usize> {
552
552
ReadInputRegisters ( data)
553
553
| ReadHoldingRegisters ( data)
554
554
| ReadWriteMultipleRegisters ( data) => 2 + data. len ( ) * 2 ,
555
- ReportServerId ( _, _, ref data) => 3 + data. len ( ) ,
555
+ ReportServerId ( _, _, data) => 3 + data. len ( ) ,
556
556
MaskWriteRegister ( _, _, _) => 7 ,
557
- Custom ( _, ref data) => 1 + data. len ( ) ,
557
+ Custom ( _, data) => 1 + data. len ( ) ,
558
558
} ;
559
559
if size > MAX_PDU_SIZE {
560
560
return Err ( io:: Error :: new (
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ impl FrameDecoder {
88
88
// Skip and record the first byte of the buffer
89
89
{
90
90
let first = buf. first ( ) . unwrap ( ) ;
91
- log:: debug!( "Dropped first byte: {:X?}" , first ) ;
91
+ log:: debug!( "Dropped first byte: {first :X?}" ) ;
92
92
if self . dropped_bytes . len ( ) >= MAX_FRAME_LEN {
93
93
log:: error!(
94
94
"Giving up to decode frame after dropping {} byte(s): {:X?}" ,
@@ -293,7 +293,7 @@ impl Decoder for ClientCodec {
293
293
. map ( |pdu| Some ( ResponseAdu { hdr, pdu } ) )
294
294
. map_err ( |err| {
295
295
// Unrecoverable error
296
- log:: error!( "Failed to decode response PDU: {}" , err ) ;
296
+ log:: error!( "Failed to decode response PDU: {err}" ) ;
297
297
err
298
298
} )
299
299
}
@@ -318,7 +318,7 @@ impl Decoder for ServerCodec {
318
318
. map ( |pdu| Some ( RequestAdu { hdr, pdu } ) )
319
319
. map_err ( |err| {
320
320
// Unrecoverable error
321
- log:: error!( "Failed to decode request PDU: {}" , err ) ;
321
+ log:: error!( "Failed to decode request PDU: {err}" ) ;
322
322
err
323
323
} )
324
324
}
Original file line number Diff line number Diff line change 54
54
}
55
55
56
56
async fn call ( & mut self , req : Request < ' _ > ) -> Result < Response > {
57
- log:: debug!( "Call {:?}" , req ) ;
57
+ log:: debug!( "Call {req :?}" ) ;
58
58
59
59
let req_function_code = req. function_code ( ) ;
60
60
let req_adu = self . next_request_adu ( req) ;
Original file line number Diff line number Diff line change 90
90
}
91
91
92
92
pub ( crate ) async fn call ( & mut self , req : Request < ' _ > ) -> Result < Response > {
93
- log:: debug!( "Call {:?}" , req ) ;
93
+ log:: debug!( "Call {req :?}" ) ;
94
94
95
95
let req_function_code = req. function_code ( ) ;
96
96
let req_adu = self . next_request_adu ( req) ;
You can’t perform that action at this time.
0 commit comments