Skip to content

Refactor parse_header to return structured type and update to Rust 2024#11

Merged
bisho merged 1 commit into
mainfrom
03-10-upgrade_rust_stable_1.94
Mar 24, 2026
Merged

Refactor parse_header to return structured type and update to Rust 2024#11
bisho merged 1 commit into
mainfrom
03-10-upgrade_rust_stable_1.94

Conversation

@bisho
Copy link
Copy Markdown
Member

@bisho bisho commented Mar 11, 2026

Motivation / Description

This pull request refactors the memcache meta-protocol response header parsing functionality to improve code organization and maintainability. The changes introduce a structured approach to handling parsed header data and update the codebase to use Rust 2024 edition features.

Changes introduced

  • Upgraded Rust edition from 2021 to 2024 in Cargo.toml
  • Replaced tuple return type with a structured ParsedHeader type containing end_pos, response_type, size, and flags fields
  • Refactored impl_parse_header function to use pattern matching with guard clauses and return structured data
  • Updated all test cases to use the new structured return type instead of tuple destructuring
  • Added Debug trait derivation to RequestFlags and ResponseFlags structs
  • Enabled from_py_object for ResponseFlags PyClass and added gil_used = false to the PyModule
  • Added safety documentation for unsafe slice creation from PyBuffer
  • Applied various clippy suggestions including allowing too_many_arguments and type_complexity lints where appropriate
  • Simplified conditional logic using let-chains syntax from Rust 2024
  • Improved code formatting and removed redundant expressions in test assertions

@bisho bisho force-pushed the 03-10-upgrade_rust_stable_1.94 branch from d0a729c to 5b2899b Compare March 11, 2026 17:31
@bisho bisho force-pushed the 03-10-upgrade_to_pyo3_0.28.2 branch from a3ee3f3 to 3c19e11 Compare March 11, 2026 17:31
@bisho bisho changed the base branch from 03-10-upgrade_to_pyo3_0.28.2 to graphite-base/11 March 16, 2026 16:09
@bisho bisho force-pushed the 03-10-upgrade_rust_stable_1.94 branch from 5b2899b to 94778c0 Compare March 16, 2026 16:09
@bisho bisho force-pushed the graphite-base/11 branch from 3c19e11 to 53a7da0 Compare March 16, 2026 16:09
@bisho bisho changed the base branch from graphite-base/11 to 03-10-optimizations_and_improvements March 16, 2026 16:09
This was referenced Mar 17, 2026
Copy link
Copy Markdown
Member Author

bisho commented Mar 24, 2026

Merge activity

  • Mar 24, 4:58 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 24, 5:03 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 24, 5:03 PM UTC: @bisho merged this pull request with Graphite.

@bisho bisho changed the base branch from 03-10-optimizations_and_improvements to graphite-base/11 March 24, 2026 16:59
@bisho bisho changed the base branch from graphite-base/11 to main March 24, 2026 17:01
@bisho bisho force-pushed the 03-10-upgrade_rust_stable_1.94 branch from 94778c0 to 3524694 Compare March 24, 2026 17:02
@bisho bisho merged commit 4d644b7 into main Mar 24, 2026
14 of 15 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