@@ -70,10 +70,10 @@ impl SmartProtocol {
7070 "HEAD"
7171 } ;
7272 let cap_list = match service_type {
73- ServiceType :: UploadPack => format ! ( "{}{}" , UPLOAD_CAP_LIST , COMMON_CAP_LIST ) ,
74- ServiceType :: ReceivePack => format ! ( "{}{}" , RECEIVE_CAP_LIST , COMMON_CAP_LIST ) ,
73+ ServiceType :: UploadPack => format ! ( "{UPLOAD_CAP_LIST}{COMMON_CAP_LIST}" ) ,
74+ ServiceType :: ReceivePack => format ! ( "{RECEIVE_CAP_LIST}{COMMON_CAP_LIST}" ) ,
7575 } ;
76- let pkt_line = format ! ( "{}{}{}{}{}{}" , head_hash , SP , name , NUL , cap_list , LF ) ;
76+ let pkt_line = format ! ( "{head_hash}{SP}{name}{NUL}{cap_list}{LF}" ) ;
7777 let mut ref_list = vec ! [ pkt_line] ;
7878
7979 for git_ref in git_refs {
@@ -152,7 +152,7 @@ impl SmartProtocol {
152152
153153 for hash in & have {
154154 if pack_handler. check_commit_exist ( hash) . await {
155- add_pkt_line_string ( & mut protocol_buf, format ! ( "ACK {} common\n " , hash ) ) ;
155+ add_pkt_line_string ( & mut protocol_buf, format ! ( "ACK {hash } common\n " ) ) ;
156156 if last_common_commit. is_empty ( ) {
157157 last_common_commit = hash. to_string ( ) ;
158158 }
@@ -174,7 +174,7 @@ impl SmartProtocol {
174174 if self . capabilities . contains ( & Capability :: NoDone ) {
175175 // If multi_ack_detailed and no-done are both present, then the sender is free to immediately send a pack
176176 // following its first "ACK obj-id ready" message.
177- add_pkt_line_string ( & mut protocol_buf, format ! ( "ACK {} ready\n " , hash ) ) ;
177+ add_pkt_line_string ( & mut protocol_buf, format ! ( "ACK {hash } ready\n " ) ) ;
178178 }
179179 }
180180 } else {
@@ -183,7 +183,7 @@ impl SmartProtocol {
183183 let ( _, rx) = tokio:: sync:: mpsc:: channel :: < Vec < u8 > > ( 1 ) ;
184184 pack_data = ReceiverStream :: new ( rx) ;
185185 }
186- add_pkt_line_string ( & mut protocol_buf, format ! ( "ACK {} \n " , last_common_commit ) ) ;
186+ add_pkt_line_string ( & mut protocol_buf, format ! ( "ACK {last_common_commit } \n " ) ) ;
187187 }
188188 Ok ( ( pack_data, protocol_buf) )
189189 }
@@ -299,7 +299,7 @@ impl SmartProtocol {
299299 pub fn build_smart_reply ( & self , ref_list : & Vec < String > , service : String ) -> BytesMut {
300300 let mut pkt_line_stream = BytesMut :: new ( ) ;
301301 if self . transport_protocol == TransportProtocol :: Http {
302- add_pkt_line_string ( & mut pkt_line_stream, format ! ( "# service={}\n " , service ) ) ;
302+ add_pkt_line_string ( & mut pkt_line_stream, format ! ( "# service={service }\n " ) ) ;
303303 pkt_line_stream. put ( & PKT_LINE_END_MARKER [ ..] ) ;
304304 }
305305
@@ -385,7 +385,7 @@ pub fn read_pkt_line(bytes: &mut Bytes) -> (usize, Bytes) {
385385 }
386386 let pkt_length = bytes. copy_to_bytes ( 4 ) ;
387387 let pkt_length = usize:: from_str_radix ( core:: str:: from_utf8 ( & pkt_length) . unwrap ( ) , 16 )
388- . unwrap_or_else ( |_| panic ! ( "{:?} is not a valid digit?" , pkt_length ) ) ;
388+ . unwrap_or_else ( |_| panic ! ( "{pkt_length :?} is not a valid digit?" ) ) ;
389389 if pkt_length == 0 {
390390 return ( 0 , Bytes :: new ( ) ) ;
391391 }
0 commit comments