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 nightly build issues with as_ref() #219

Closed
wants to merge 5 commits into from

Conversation

nevi-me
Copy link

@nevi-me nevi-me commented May 17, 2019

fixes #217

I spent part of the day trying to see what change to Rust introduced this issue, but came blank. I've replaced string.as_ref() with a clone, which fixes the issue. If clone is a problem, we could resolve this later (though I was able to fix the error in a different way which was a bit longer). Found a better fix of passing a &str, and annotating it as such where necessary.

cc @gwenn

@nevi-me nevi-me mentioned this pull request May 17, 2019
@gwenn gwenn added the invalid label May 17, 2019
@gwenn
Copy link
Collaborator

gwenn commented May 17, 2019

We don't want to clone/allocate until we are sure that:

        if line.as_ref().is_empty()
            || (self.ignore_space
                && line
                    .as_ref()
                    .chars()
                    .next()
                    .map_or(true, char::is_whitespace))
        {
            return false;
        }
        if self.ignore_dups {
            if let Some(s) = self.entries.back() {
                if s == line.as_ref() {
                    return false;
                }
            }
        }

@nevi-me
Copy link
Author

nevi-me commented May 17, 2019

That's fine,, please check my latest commit

@gwenn gwenn removed the invalid label May 17, 2019
@nevi-me
Copy link
Author

nevi-me commented May 17, 2019

Darn, it "worked on my machine", I'll investigate the failures

@nevi-me
Copy link
Author

nevi-me commented May 17, 2019

Nearly there, it's currently the example that's failing. Struggling to repro as I don't have the history.txt file

so we can print reference and consume line
@nevi-me
Copy link
Author

nevi-me commented May 17, 2019

@gwenn is the current solution acceptable?

@gwenn
Copy link
Collaborator

gwenn commented May 17, 2019

I hope/guess you will consider #218 to be better.
Thanks for your help/time.

@nevi-me
Copy link
Author

nevi-me commented May 17, 2019

Yes, I just saw it, and I'll close this.

Will you be able to release a 4.0.1 today?

@nevi-me nevi-me closed this May 17, 2019
@gwenn
Copy link
Collaborator

gwenn commented May 17, 2019

Do you mind if a 4.1.0 is released instead ?
I am not sure that we don't have introduce any regression with old stables

@nevi-me
Copy link
Author

nevi-me commented May 17, 2019

Do you mind if a 4.1.0 is released instead ?
I am not sure that we don't have introduce any regression with old stables

Either one, I haven't used rustyline before, so I wouldn't know what would be appropriate. I only looked at this because it was blocking a growing number of PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation fails on nightly-2019-05-16
2 participants