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

fix(enums): Add pub use/namespacing where required #118

Closed
wants to merge 1 commit into from

Conversation

iterion
Copy link
Contributor

@iterion iterion commented Nov 18, 2014

BREAKING CHANGE: This change will require users to reference
mime types using their namespace. i.e. MediaType::Json.
Rust enums were updated in the latest nightly (rust-lang/rust#18973).

I added pub use in places where the enums wouldn't be poluting user
namespaces with a large amount of names.

I also switched to the upstreams of rust-http and rust-url. It seems that the nickel-org forks no longer diverge from their upstreams. I'm happy to split this change into a second PR.

@iterion iterion changed the title Enum Namespacing fix(enums): Add pub use/namespacing where required Nov 18, 2014
@Ryman
Copy link
Member

Ryman commented Nov 18, 2014

@iterion Might want to hold off on the 2nd commit pending a decision on #113. We were trying to minimize dependency churn but it seems to have caused unintended side effects so we may be reverting the changes.

I'm assuming the travis failure is just it running an old rustc which still has libtime?

I haven't looked at other projects since the enum namespacing changes, is re-exporting in the parent namespace common? Perhaps it's cleaner to just break/depreciate current code and push users to import variants themselves if they don't wish to qualify them?

@iterion
Copy link
Contributor Author

iterion commented Nov 18, 2014

Ahh, didn't see #113, I'll add my thoughts on that there.

I'll pull out the second commit for now, it may break the build as I think some of the nickel-org forks are also broken because of the enum namespace refactor.

I haven't looked at other projects since the enum namespacing changes, is re-exporting in the parent namespace common? Perhaps it's cleaner to just break/depreciate current code and push users to import variants themselves if they don't wish to qualify them?

I'm not sure of the correct way to approach this. In the few projects I've looked at since the change it seems they're just re-exporting. I handled the MediaType enum differently since it was the easiest (maybe the only) approach with the macro that is being used there.

@iterion
Copy link
Contributor Author

iterion commented Nov 18, 2014

I'm assuming the travis failure is just it running an old rustc which still has libtime?

Yeah, it seems rustc builds are still being released with libtime but it's been deprecated. Locally my solution has just been to delete the libtime files that are distributed with rustc. I'm sure there is a better way to handle it.

@pzol
Copy link

pzol commented Nov 19, 2014

@iterion yeah, can you add to Cargo.toml?

[dependencies.time]
git = "https://github.com/rust-lang/time"

BREAKING CHANGE: This change will require downstream users to reference
mime types using their namespace. i.e. MediaType::Json

I added pub use in places where the enums wouldn't be poluting user
namespaces with a large amount of names.
@iterion
Copy link
Contributor Author

iterion commented Nov 19, 2014

Added, thanks.

@Ryman
Copy link
Member

Ryman commented Nov 19, 2014

@iterion I updated the cargo file and amended your commit to add a missed update in src/response.rs.

(Started before your latest commit change but had dependencies to fix, should be a working master now)

So, this is merged but github probably wont show it since you changed the commit, but thanks! :)

@Ryman Ryman closed this Nov 19, 2014
@iterion
Copy link
Contributor Author

iterion commented Nov 19, 2014

No worries, thanks for the merge!

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