Skip to content

Commit f91042a

Browse files
ref(api): Make with_retry return Self (#2365)
Ref #2357
1 parent 47f7981 commit f91042a

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/api/mod.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl Api {
402402
http::HTTP_STATUS_503_SERVICE_UNAVAILABLE,
403403
http::HTTP_STATUS_504_GATEWAY_TIMEOUT,
404404
],
405-
)?
405+
)
406406
.progress_bar_mode(progress_bar_mode);
407407

408408
// The request is performed to an absolute URL. Thus, `Self::request()` will
@@ -974,7 +974,7 @@ impl<'a> AuthenticatedApi<'a> {
974974
http::HTTP_STATUS_503_SERVICE_UNAVAILABLE,
975975
http::HTTP_STATUS_504_GATEWAY_TIMEOUT,
976976
],
977-
)?
977+
)
978978
.send()?
979979
.convert_rnf(ApiErrorKind::ProjectNotFound)
980980
}
@@ -1007,7 +1007,7 @@ impl<'a> AuthenticatedApi<'a> {
10071007
http::HTTP_STATUS_503_SERVICE_UNAVAILABLE,
10081008
http::HTTP_STATUS_504_GATEWAY_TIMEOUT,
10091009
],
1010-
)?
1010+
)
10111011
.send()?
10121012
.convert_rnf(ApiErrorKind::ReleaseNotFound)
10131013
}
@@ -1038,7 +1038,7 @@ impl<'a> AuthenticatedApi<'a> {
10381038
http::HTTP_STATUS_503_SERVICE_UNAVAILABLE,
10391039
http::HTTP_STATUS_504_GATEWAY_TIMEOUT,
10401040
],
1041-
)?
1041+
)
10421042
.send()?
10431043
.convert_rnf(ApiErrorKind::ReleaseNotFound)
10441044
}
@@ -1415,7 +1415,7 @@ impl RegionSpecificApi<'_> {
14151415
)
14161416
})?,
14171417
&[http::HTTP_STATUS_507_INSUFFICIENT_STORAGE],
1418-
)?
1418+
)
14191419
.progress_bar_mode(ProgressBarMode::Request)
14201420
.send()?
14211421
.convert()
@@ -1481,7 +1481,7 @@ impl RegionSpecificApi<'_> {
14811481
http::HTTP_STATUS_503_SERVICE_UNAVAILABLE,
14821482
http::HTTP_STATUS_504_GATEWAY_TIMEOUT,
14831483
],
1484-
)?
1484+
)
14851485
.progress_bar_mode(progress_bar_mode)
14861486
.send()?;
14871487
if resp.status() == 409 {
@@ -1745,15 +1745,11 @@ impl ApiRequest {
17451745
self
17461746
}
17471747

1748-
#[expect(clippy::unnecessary_wraps)]
1749-
pub fn with_retry(
1750-
mut self,
1751-
max_retries: u32,
1752-
retry_on_statuses: &'static [u32],
1753-
) -> ApiResult<Self> {
1748+
pub fn with_retry(mut self, max_retries: u32, retry_on_statuses: &'static [u32]) -> Self {
17541749
self.max_retries = max_retries;
17551750
self.retry_on_statuses = retry_on_statuses;
1756-
Ok(self)
1751+
1752+
self
17571753
}
17581754

17591755
/// Get a copy of the header list

0 commit comments

Comments
 (0)