File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,17 +102,17 @@ pub enum StoreError {
102102impl IntoResponse for StoreError {
103103 fn into_response ( self ) -> axum:: response:: Response {
104104 match self {
105- StoreError :: UploadLimitExceeded => Response :: builder ( )
105+ Self :: UploadLimitExceeded => Response :: builder ( )
106106 . status ( StatusCode :: PAYLOAD_TOO_LARGE )
107107 . body ( Body :: from ( "Upload limit exceeded" ) )
108108 . unwrap ( ) ,
109- StoreError :: Stream ( err) => Response :: builder ( )
109+ Self :: Stream ( err) => Response :: builder ( )
110110 . status ( StatusCode :: BAD_REQUEST )
111111 . body ( Body :: from ( format ! (
112112 "Failed to read multipart stream: {err:#}"
113113 ) ) )
114114 . unwrap ( ) ,
115- StoreError :: ReadDicomFile ( err) => Response :: builder ( )
115+ Self :: ReadDicomFile ( err) => Response :: builder ( )
116116 . status ( StatusCode :: BAD_REQUEST )
117117 . body ( Body :: from ( format ! ( "Failed to read DICOM file: {err:#}" ) ) )
118118 . unwrap ( ) ,
@@ -130,10 +130,10 @@ impl From<multer::Error> for StoreError {
130130 . is_some ( ) ;
131131
132132 if is_limit_exceeded {
133- return StoreError :: UploadLimitExceeded ;
133+ return Self :: UploadLimitExceeded ;
134134 }
135135 }
136136
137- StoreError :: Stream ( error)
137+ Self :: Stream ( error)
138138 }
139139}
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ async fn instance_resource(
8484 Response :: builder ( )
8585 . header (
8686 CONTENT_DISPOSITION ,
87- format ! ( r#"attachment; filename="{study_instance_uid}""# , ) ,
87+ format ! ( r#"attachment; filename="{study_instance_uid}""# ) ,
8888 )
8989 . header (
9090 CONTENT_TYPE ,
Original file line number Diff line number Diff line change @@ -52,10 +52,10 @@ pub enum RetrieveError {
5252impl IntoResponse for RetrieveError {
5353 fn into_response ( self ) -> Response {
5454 match self {
55- RetrieveError :: Backend { source } => {
55+ Self :: Backend { source } => {
5656 ( StatusCode :: INTERNAL_SERVER_ERROR , source. to_string ( ) ) . into_response ( )
5757 }
58- RetrieveError :: Unimplemented => Response :: builder ( )
58+ Self :: Unimplemented => Response :: builder ( )
5959 . status ( StatusCode :: NOT_IMPLEMENTED )
6060 . body ( Body :: from ( "This transaction is not implemented." ) )
6161 . unwrap ( ) ,
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ impl FindServiceClassUser {
4343 Self { pool, timeout }
4444 }
4545
46+ #[ allow( clippy:: significant_drop_tightening) ]
4647 pub fn invoke (
4748 & self ,
4849 options : FindServiceClassUserOptions ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ impl MoveServiceClassUser {
2323 }
2424
2525 #[ instrument( skip_all, name = "MOVE-SCU" ) ]
26+ #[ allow( clippy:: significant_drop_tightening) ]
2627 pub async fn invoke ( & self , request : CompositeMoveRequest ) -> Result < ( ) , MoveError > {
2728 let association = self
2829 . pool
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ impl StoreServiceClassUser {
2121 Self { pool, timeout }
2222 }
2323
24+ #[ allow( clippy:: significant_drop_tightening) ]
2425 pub async fn store ( & self , file : FileDicomObject < InMemDicomObject > ) -> Result < ( ) , StoreError > {
2526 let association = self
2627 . pool
Original file line number Diff line number Diff line change @@ -264,6 +264,7 @@ impl<'a> DicomMultipartStream<'a> {
264264 + Send
265265 + ' a ,
266266 ) -> Self {
267+ #[ allow( clippy:: result_large_err) ]
267268 let multipart_stream = stream
268269 . map ( |item| {
269270 item. and_then ( |object| {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use crate::config::{AppConfig, HttpServerConfig};
1414use crate :: types:: AE ;
1515use association:: pool:: AssociationPools ;
1616use axum:: extract:: { DefaultBodyLimit , Request } ;
17+ use axum:: http:: StatusCode ;
1718use axum:: response:: Response ;
1819use axum:: ServiceExt ;
1920use std:: net:: SocketAddr ;
@@ -143,9 +144,10 @@ async fn run(config: AppConfig) -> anyhow::Result<()> {
143144 . on_response ( trace:: DefaultOnResponse :: new ( ) . level ( Level :: INFO ) ) ,
144145 )
145146 . layer ( DefaultBodyLimit :: max ( config. server . http . max_upload_size ) )
146- . layer ( TimeoutLayer :: new ( Duration :: from_secs (
147- config. server . http . request_timeout ,
148- ) ) )
147+ . layer ( TimeoutLayer :: with_status_code (
148+ StatusCode :: REQUEST_TIMEOUT ,
149+ Duration :: from_secs ( config. server . http . request_timeout ) ,
150+ ) )
149151 . with_state ( app_state) ;
150152
151153 let app = NormalizePathLayer :: trim_trailing_slash ( ) . layer ( app) ;
Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ pub struct ServerProcess {
3434
3535impl ServerProcess {
3636 fn spawn ( config : & str ) -> anyhow:: Result < Self > {
37- let workdir =
38- std:: env:: temp_dir ( ) . join ( format ! ( "dicom-rst-{}" , uuid:: Uuid :: new_v4( ) . to_string( ) ) ) ;
37+ let workdir = std:: env:: temp_dir ( ) . join ( format ! ( "dicom-rst-{}" , uuid:: Uuid :: new_v4( ) ) ) ;
3938 std:: fs:: create_dir_all ( & workdir) ?;
4039 std:: fs:: write ( workdir. join ( "config.yaml" ) , config) ?;
4140
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use dicom::object::open_file;
88use dicom_web:: DicomWebError ;
99use std:: time:: { Duration , Instant } ;
1010
11+ #[ allow( clippy:: redundant_closure_for_method_calls) ]
1112#[ tokio:: test]
1213async fn can_upload_study_instances ( ) -> anyhow:: Result < ( ) > {
1314 let config = "
You can’t perform that action at this time.
0 commit comments