@@ -269,19 +269,16 @@ impl<'a> DicomMultipartStream<'a> {
269269 + ' a ,
270270 transfer_syntax_uid : Option < & str > ,
271271 ) -> Self {
272- let transfer_syntax_uid = transfer_syntax_uid
273- . map ( |ts_uid| TransferSyntaxRegistry . get ( & ts_uid) )
274- . flatten ( ) ;
272+ let transfer_syntax_uid =
273+ transfer_syntax_uid. and_then ( |ts_uid| TransferSyntaxRegistry . get ( ts_uid) ) ;
275274
276275 let multipart_stream = stream
277276 . map ( move |item| {
278- let transfer_syntax_uid = transfer_syntax_uid. clone ( ) ;
277+ let transfer_syntax_uid = transfer_syntax_uid;
279278 item. and_then ( |object| {
280279 if let Some ( ts) = transfer_syntax_uid {
281280 let mut transcoded = ( * object) . clone ( ) ;
282- transcoded
283- . transcode ( & ts)
284- . map_err ( |err| MoveError :: Transcode ( err) ) ?;
281+ transcoded. transcode ( ts) . map_err ( MoveError :: Transcode ) ?;
285282 Self :: write ( & transcoded)
286283 . map_err ( |err| MoveError :: Write ( WriteError :: Io ( err) ) )
287284 } else {
@@ -310,11 +307,10 @@ impl<'a> DicomMultipartStream<'a> {
310307 writeln ! ( buffer, "--boundary\r " ) ?;
311308 writeln ! (
312309 buffer,
313- "Content-Type: {}; transfer-syntax=\" {}\" \r " ,
314- "application/dicom" ,
310+ "Content-Type: application/dicom; transfer-syntax=\" {}\" \r " ,
315311 file. meta( ) . transfer_syntax. trim_end_matches( '\0' )
316312 ) ?;
317- writeln ! ( buffer, "Content-Length: {}\r " , file_length ) ?;
313+ writeln ! ( buffer, "Content-Length: {file_length }\r " ) ?;
318314 writeln ! ( buffer, "\r " ) ?;
319315 buffer. append ( & mut dcm) ;
320316 writeln ! ( buffer, "\r " ) ?;
0 commit comments