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(socketio/packet): switch to Str type for ns path storage #334

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

Totodore
Copy link
Owner

Motivation

Currently the namespace path is decoded from a Str payload, meaning that we can extract it in a zero copy manner by slicing the Str and storing it like that.
It also fixes a lifetime issue for PR #333 with path params. Because the path need to outlive the decoded params from the matchit router as long as they are not decoded by the user.

Solution

  • Switch the namespace path to a Str.
  • Add some implementation of From for Str for the construction of new outgoing packets.

socketioxide/src/packet.rs Fixed Show fixed Hide fixed
socketioxide/src/packet.rs Fixed Show fixed Hide fixed
@Totodore Totodore enabled auto-merge (squash) June 13, 2024 13:51
@Totodore Totodore disabled auto-merge June 13, 2024 13:52
@Totodore Totodore merged commit dcfa088 into main Jun 13, 2024
15 checks passed
@Totodore Totodore deleted the feat-switch-to-str-for-ns branch June 14, 2024 08:49
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.

1 participant