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

impl Deref for CompleteStr, CompleteByteSlice #715

Merged
merged 1 commit into from
Mar 26, 2018
Merged

impl Deref for CompleteStr, CompleteByteSlice #715

merged 1 commit into from
Mar 26, 2018

Conversation

lorepozo
Copy link
Contributor

@lorepozo lorepozo commented Mar 14, 2018

With the impending increased use of CompleteStr and CompleteByteSlice in 4.0, this should give users (myself included) an easier time with low overhead.

Instead of:

named!(var<CompleteStr, Item>,
        do_parse!(
            name: ws!( alpha ) >>
            (Item::Var(name.0.to_string()))
        ));

We can avoid explicitly getting name.0 thanks to Deref:

named!(var<CompleteStr, Item>,
        do_parse!(
            name: ws!( alpha ) >>
            (Item::Var(name.to_string()))
        ));

@Geal Geal merged commit c58f214 into rust-bakery:master Mar 26, 2018
@Geal
Copy link
Collaborator

Geal commented Mar 26, 2018

Thanks!

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.

None yet

2 participants