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

future-proof FromForm against scope resolution changes #705

Closed
wants to merge 2 commits into from

Conversation

jebrosen
Copy link
Collaborator

@jebrosen jebrosen commented Jul 13, 2018

See rust-lang/rust#50504, rust-lang/rust#51952.

There is uncertainty regarding proc_macro hygiene and whether this actually future-proofs, and those concerns would need to be addressed before taking this approach.

use self::std::prelude::v1::*;
use self::rocket::request::FromFormValue;
use self::rocket::http::RawStr;
fn from_form_value(v: &'v ::rocket::http::RawStr) -> Result<Self, Self::Error> {
Copy link
Member

Choose a reason for hiding this comment

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

Should this also be ::std::result::Result?

@jebrosen
Copy link
Collaborator Author

Instead of this significant change, use super::*;, use super::#name;, or typing out super::#name as necessary should be no better or worse than the current code wrt hygiene, but will silence the warning in consuming crates.

@SergioBenitez
Copy link
Member

Merged in 706cd32.

@SergioBenitez SergioBenitez added the pr: merged This pull request was merged manually. label Jul 25, 2018
@jebrosen jebrosen deleted the fromform_futureproof branch July 25, 2018 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: merged This pull request was merged manually.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants