File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -256,14 +256,13 @@ async fn get_search_results(
256256// Categorize errors from registry
257257fn handle_registry_error ( err : anyhow:: Error ) -> Result < SearchResult , SearchError > {
258258 // Capture crates.io API error
259- if let Some ( registry_request_error) = err. downcast_ref :: < reqwest:: Error > ( ) {
260- if let Some ( status) = registry_request_error. status ( ) {
261- if status. is_client_error ( ) || status. is_server_error ( ) {
262- return Err ( SearchError :: CratesIo ( format ! (
263- "crates.io returned {status}: {registry_request_error}"
264- ) ) ) ;
265- }
266- }
259+ if let Some ( registry_request_error) = err. downcast_ref :: < reqwest:: Error > ( )
260+ && let Some ( status) = registry_request_error. status ( )
261+ && ( status. is_client_error ( ) || status. is_server_error ( ) )
262+ {
263+ return Err ( SearchError :: CratesIo ( format ! (
264+ "crates.io returned {status}: {registry_request_error}"
265+ ) ) ) ;
267266 }
268267 // Move all other error types to this wrapper
269268 Err ( SearchError :: Other ( err) )
You can’t perform that action at this time.
0 commit comments