fix: address CI failures and reviewer feedback on #3214

- Add missing retry_after: None field to ApiError::Api construction
  in main.rs test. This field was introduced by the Retry-After
  header support but was not added to the test's error initializer,
  causing a compile error under CI's strict mode.

- Remove duplicate #[must_use] attribute on retry_after() method
  in error.rs (lines 134+138 both had it; kept the outer one
  above the doc comment per convention).

- Cargo fmt --all run.

- Reviewer question "Are defaults preserved?" — answered yes:
  ApiTimeoutConfig defaults to 30s connect / 300s request / 8 retries.
  with_retry_policy() is opt-in. No behavior change without explicit
  configuration.
This commit is contained in:
TheArchitectit
2026-06-03 13:19:25 -05:00
parent 04bc5f5788
commit 76783377ec
2 changed files with 2 additions and 2 deletions

View File

@@ -135,7 +135,6 @@ impl ApiError {
/// Return the `Retry-After` delay if this error came from a 429 response /// Return the `Retry-After` delay if this error came from a 429 response
/// that included a `retry-after` header. Callers should prefer this value /// that included a `retry-after` header. Callers should prefer this value
/// over the computed backoff delay when it exists. /// over the computed backoff delay when it exists.
#[must_use]
pub fn retry_after(&self) -> Option<Duration> { pub fn retry_after(&self) -> Option<Duration> {
match self { match self {
Self::Api { retry_after, .. } => *retry_after, Self::Api { retry_after, .. } => *retry_after,

View File

@@ -11693,6 +11693,7 @@ mod tests {
body: String::new(), body: String::new(),
retryable: false, retryable: false,
suggested_action: None, suggested_action: None,
retry_after: None,
}; };
let rendered = format_user_visible_api_error("session-issue-32", &error); let rendered = format_user_visible_api_error("session-issue-32", &error);
@@ -11728,7 +11729,7 @@ mod tests {
retryable: false, retryable: false,
suggested_action: None, suggested_action: None,
retry_after: None, retry_after: None,
}), }),
}; };
let rendered = format_user_visible_api_error("session-issue-32", &error); let rendered = format_user_visible_api_error("session-issue-32", &error);