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

Re-export http crate #166

Merged
merged 1 commit into from
Apr 15, 2019
Merged

Re-export http crate #166

merged 1 commit into from
Apr 15, 2019

Conversation

pbzweihander
Copy link
Contributor

@pbzweihander pbzweihander commented Apr 12, 2019

Description

I added pub use http; in lib.rs

Motivation and Context

Since tide heavily depends on http crate, it would be great if we can use http crate without adding to Cargo.toml.

How Has This Been Tested?

I checked via cargo doc that the http crate is re-exported.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@secretfader
Copy link

secretfader commented Apr 12, 2019

You might want to consider pub use http as a better approach. In Rust 2018, extern crate is unnecessary since dependencies are managed in Cargo.toml.

@yoshuawuyts
Copy link
Member

@pbzweihander how are you using the http crate? If there's anything in particular missing from what we're exposing it'd be great to know.

@pbzweihander
Copy link
Contributor Author

@yoshuawuyts Especially StatusCode. If I want to use with_status of IntoResponse, I have to import StatusCode from http

@secretfader
Copy link

secretfader commented Apr 14, 2019

I also frequently import the http crate. Usually, I'm creating redirect responses or other functionality that I expect will eventually be implemented in Tide.

Until Tide includes conveniences for all possible responses, exporting http seems like a decent option.

@yoshuawuyts
Copy link
Member

Until Tide includes conveniences for all possible responses, exporting http seems like a decent option.

We're thinking of how to reduce the Tide API to just the core parts (#162), so I'm a bit cautious around additions that we know we don't want to keep in the long term.

That said, it does feel like exporting http will almost always remain useful, even if we expose shorthands, so it doesn't seem unreasonable to include this as part of core.

@yoshuawuyts yoshuawuyts merged commit 2791a61 into http-rs:master Apr 15, 2019
@pbzweihander pbzweihander deleted the re-export-http branch April 15, 2019 10:30
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