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

Response: add From<StatusCode> #650

Merged
merged 1 commit into from
Jul 18, 2020

Conversation

Fishrock123
Copy link
Member

Description

Allows you to do e.g. Ok(NotFound) from an Endpoint / Middleware.

Motivation and Context

Ergonomics

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Allows you to do e.g. `Ok(NotFound)` from an Endpoint / Middleware.
Copy link
Member

@jbr jbr left a comment

Choose a reason for hiding this comment

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

Tempting to also add a u16 variant of this (for Ok(404) but that’s probably too far

@yoshuawuyts yoshuawuyts merged commit 00670b3 into http-rs:master Jul 18, 2020
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.

3 participants