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

Modify define_encode_set to support private definitions #307

Closed
brson opened this issue May 4, 2017 · 2 comments
Closed

Modify define_encode_set to support private definitions #307

brson opened this issue May 4, 2017 · 2 comments

Comments

@brson
Copy link
Contributor

brson commented May 4, 2017

Right now all encode sets must be explicitly pub. Generally such macros should have a grammar that accepts non-pub definitions.

It doesn't look like the existing grammar supports this extension though:

define_encode_set! {
    /// This encode set is used in the URL parser for query strings.
    pub QUERY_ENCODE_SET = [SIMPLE_ENCODE_SET] | {' ', '"', '#', '<', '>'}
}

There's no other keyword there besides pub. Seems like this definition would be better if you had to type like pub struct QUERY_ENCODE_SET.

So fixing this might require adding two rules and basically deprecating the existing rule? Not sure.

@SimonSapin
Copy link
Member

As discussed in #298 (comment) this is a very niche feature, so extending it seems low value. In particular it doesn’t seem worth adding new APIs and deprecating old ones, to me.

@brson
Copy link
Contributor Author

brson commented May 13, 2017

@SimonSapin ok, sgtm.

@brson brson closed this as completed May 13, 2017
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

No branches or pull requests

2 participants