Skip to content

Validate legacy error response statuses#146

Merged
RAprogramm merged 1 commit intonew_verisonfrom
eye-of-ra/refactor-errorresponse-validation-and-tests
Sep 27, 2025
Merged

Validate legacy error response statuses#146
RAprogramm merged 1 commit intonew_verisonfrom
eye-of-ra/refactor-errorresponse-validation-and-tests

Conversation

@RAprogramm
Copy link
Owner

Summary

  • validate ErrorResponse::new_legacy status codes before constructing responses
  • reuse the provided message without cloning when the status is valid or invalid
  • add regression coverage for both valid and fallback code paths of the legacy constructor

Testing

  • cargo +nightly fmt --
  • cargo +1.90.0 clippy -- -D warnings
  • cargo +1.90.0 build --all-targets
  • cargo +1.90.0 test --all
  • cargo +1.90.0 doc --no-deps
  • cargo audit
  • cargo deny check

https://chatgpt.com/codex/tasks/task_e_68d77de97238832ba4497b48b5fc64bb

@RAprogramm RAprogramm merged commit 22844e1 into new_verison Sep 27, 2025
1 of 2 checks passed
@RAprogramm RAprogramm deleted the eye-of-ra/refactor-errorresponse-validation-and-tests branch September 27, 2025 06:17
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

pub fn new_legacy(status: u16, message: impl Into<String>) -> Self {

[P1] Restore alloc::String import for no_std builds

The diff drops use alloc::string::String, but new_legacy still uses impl Into<String>. That compiles with the default std feature because the standard prelude re‑exports String, yet the crate explicitly supports no_std (#![cfg_attr(not(feature = "std"), no_std)]). When consumers build with --no-default-features, String is no longer in scope and this module fails to compile. Reintroduce the alloc::string::String import or fully qualify the type so the function remains usable in no_std configurations.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant