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

feat: support compact_str for oapi #1024

Merged
merged 1 commit into from
Jan 10, 2025
Merged

feat: support compact_str for oapi #1024

merged 1 commit into from
Jan 10, 2025

Conversation

Yvictor
Copy link
Contributor

@Yvictor Yvictor commented Jan 10, 2025

Description

This pull request introduces support for the compact_str crate in the salvo web framework’s OpenAPI integration. The use of compact_str provides an efficient and lightweight alternative to String, particularly beneficial for scenarios involving small strings, reducing memory overhead without sacrificing usability.

Key Changes

  • Implemented support for compact_str in relevant OpenAPI structures and code paths.
  • Ensured compatibility with existing String behavior, maintaining seamless integration for developers.

Why This is Needed

The compact_str crate offers significant performance and memory usage advantages for string-heavy applications. This addition makes salvo more flexible and optimized for use cases where efficient memory utilization is critical, aligning with modern Rust best practices.

@chrislearn chrislearn merged commit cfc5cde into salvo-rs:main Jan 10, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants