@@ -24,7 +24,11 @@ const AVAILABLE_AFTER: TimeDelta = TimeDelta::hours(24);
2424/// crate has been published for less than 72 hours, or if the crate has a
2525/// single owner, has been downloaded less than 100 times for each month it has
2626/// been published, and is not depended upon by any other crate on crates.io.
27- pub async fn delete ( Path ( name) : Path < String > , parts : Parts , app : AppState ) -> AppResult < ( ) > {
27+ pub async fn delete (
28+ Path ( name) : Path < String > ,
29+ parts : Parts ,
30+ app : AppState ,
31+ ) -> AppResult < StatusCode > {
2832 let mut conn = app. db_write ( ) . await ?;
2933
3034 // Check that the user is authenticated
@@ -107,7 +111,7 @@ pub async fn delete(Path(name): Path<String>, parts: Parts, app: AppState) -> Ap
107111 } )
108112 . await ?;
109113
110- Ok ( ( ) )
114+ Ok ( StatusCode :: NO_CONTENT )
111115}
112116
113117async fn find_crate ( conn : & mut AsyncPgConnection , name : & str ) -> QueryResult < Option < Crate > > {
@@ -177,7 +181,7 @@ mod tests {
177181 " ) ;
178182
179183 let response = delete_crate ( & user, "foo" ) . await ;
180- assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
184+ assert_eq ! ( response. status( ) , StatusCode :: NO_CONTENT ) ;
181185 assert ! ( response. body( ) . is_empty( ) ) ;
182186
183187 // Assert that the crate no longer exists
@@ -212,7 +216,7 @@ mod tests {
212216 " ) ;
213217
214218 let response = delete_crate ( & user, "foo" ) . await ;
215- assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
219+ assert_eq ! ( response. status( ) , StatusCode :: NO_CONTENT ) ;
216220 assert ! ( response. body( ) . is_empty( ) ) ;
217221
218222 // Assert that the crate no longer exists
@@ -247,7 +251,7 @@ mod tests {
247251 " ) ;
248252
249253 let response = delete_crate ( & user, "foo" ) . await ;
250- assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
254+ assert_eq ! ( response. status( ) , StatusCode :: NO_CONTENT ) ;
251255 assert ! ( response. body( ) . is_empty( ) ) ;
252256
253257 // Assert that the crate no longer exists
0 commit comments