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

Upgrade bitflags to v2.3 #2067

Closed
wants to merge 2 commits into from
Closed

Upgrade bitflags to v2.3 #2067

wants to merge 2 commits into from

Conversation

rsdlt
Copy link
Contributor

@rsdlt rsdlt commented Jul 2, 2023

Include bitflags v2.3 in axum/Cargo.toml.
Derive required macros for EventFlags and MethodFilter structs.
Run cargo check / build / test to validate.

Refs: #2066

Motivation

Motivation explained in Refs: #2066

Solution

Upgrade bitflags to v2.3 in axum/Cargo.toml.
Derive only the required macros in bitflags v2+ for EventFlags and MethodFilter structs.
Run cargo check / build / test to validate.

Include bitflags v2.3 in axum/Cargo.toml.
Derive required macros for EventFlags and MethodFilter structs.
Run cargo check / build / test to validate.

Refs: #2066
@davidpdrsn
Copy link
Member

Hm I'm not a fan of how it makes bitflags part of our public api with the PublicFlags type:

image

I have been wondering if we should just ditch bitflags and define our own type as

struct MethodFilter {
    delete: bool,
    get: bool,
    head: bool,
    options: bool,
    patch: bool,
    post: bool,
    put: bool,
    trace: bool,
}

Then we could also expose just the methods we think users need, instead the kitchen sink that bitflags generates.

@rsdlt
Copy link
Contributor Author

rsdlt commented Jul 2, 2023

Hm I'm not a fan of how it makes bitflags part of our public api with the PublicFlags type:

image I have been wondering if we should just ditch bitflags and define our own type as
struct MethodFilter {
    delete: bool,
    get: bool,
    head: bool,
    options: bool,
    patch: bool,
    post: bool,
    put: bool,
    trace: bool,
}

Then we could also expose just the methods we think users need, instead the kitchen sink that bitflags generates.

I think that's a better approach. An added benefit is not having to worry about breaking changes from bitflags in the future if they happen.

I suggest we close this PR and I'll try to tackle it this way.

Cheers.

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