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

Should conversions to StatusCode be implemented on more num types? #230

Open
carllerche opened this issue Jul 21, 2018 · 2 comments · May be fixed by #451
Open

Should conversions to StatusCode be implemented on more num types? #230

carllerche opened this issue Jul 21, 2018 · 2 comments · May be fixed by #451
Labels
A-status Area: Status Codes B-rfc Blocked: request for comments. More discussion would help move this along. S-feature Severity: feature. This adds something new.

Comments

@carllerche
Copy link
Collaborator

Currently, it is only u16. For convenience, it would be nice to implement conversions for other num types: usize, u32, u64.

@seanmonstar seanmonstar added S-feature Severity: feature. This adds something new. B-rfc Blocked: request for comments. More discussion would help move this along. A-status Area: Status Codes labels Oct 18, 2018
@seanmonstar
Copy link
Member

The title says to StatusCode, so it this StatusCode::try_from(usize), etc?

I'm -0. I think asking people to realize that a status code is a u16 is useful, and people can convert their number into one themselves. However, I guess it's helpful for things like the response::Builder, so a user who received something like a u32 can just pass it, instead of possibly casting incorrectly.

@StevenDoesStuffs
Copy link

I think it'd be nice to have other number types be able to convert to StatusCode too.

@dekellum dekellum linked a pull request Dec 11, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-status Area: Status Codes B-rfc Blocked: request for comments. More discussion would help move this along. S-feature Severity: feature. This adds something new.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants