Skip to content

refactor(cookie): fix alias binding of SameSite::Empty to None#13

Merged
0x676e67 merged 1 commit intomainfrom
cookie
Nov 21, 2025
Merged

refactor(cookie): fix alias binding of SameSite::Empty to None#13
0x676e67 merged 1 commit intomainfrom
cookie

Conversation

@0x676e67
Copy link
Collaborator

Ruby does not have a None type like Python.
Therefore, creating an alias that maps SameSite::Empty to None is unnecessary and may even cause confusion, since Ruby conventions typically use nil to represent the absence of a value.
To keep the API consistent with Ruby’s type system and avoid implying Python-style semantics, the alias has been removed / corrected accordingly.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the SameSite cookie attribute by renaming the Empty variant to None, aligning it with the underlying Rust cookie crate's enum and standard cookie semantics.

Key Changes:

  • Renamed SameSite::Empty to SameSite::None in the Rust enum definition
  • Updated constant registration to expose SameSite::None instead of SameSite::Empty
  • Updated Ruby stub documentation to reflect the None constant

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/cookie.rs Updated define_ruby_enum! macro invocation to use None variant instead of tuple mapping (Empty, None), and updated constant registration from Empty to None
lib/wreq_ruby/cookie.rb Renamed Ruby constant from Empty to None and updated associated documentation comment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@0x676e67 0x676e67 merged commit c08f3c5 into main Nov 21, 2025
9 checks passed
@0x676e67 0x676e67 deleted the cookie branch November 21, 2025 10:29
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