Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update ntex-cors doc to use http::Method instead of &str #16

Merged
merged 1 commit into from
Apr 1, 2025

Conversation

Rayato159
Copy link
Contributor

This PR improves the documentation for allowed_methods in ntex-cors.

The current doc example uses vector of &str (e.g. vec!["GET", "POST"]), which is valid but might lead to runtime errors due to typos or unsupported values.

This update suggests using http::Method enum instead, which improves type safety and better aligns with idiomatic Rust practices.

Why?

  • Prevent possible runtime errors
  • Improve developer experience
  • Promote usage of enums over raw strings

@fafhrd91 fafhrd91 merged commit c8682e0 into ntex-rs:master Apr 1, 2025
2 of 9 checks passed
@fafhrd91
Copy link
Member

fafhrd91 commented Apr 1, 2025

thanks!

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

Successfully merging this pull request may close these issues.

2 participants