Skip to content

Slicing syntax very unergonomic in latest nightly #20743

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

Closed
mahkoh opened this issue Jan 8, 2015 · 5 comments
Closed

Slicing syntax very unergonomic in latest nightly #20743

mahkoh opened this issue Jan 8, 2015 · 5 comments

Comments

@mahkoh
Copy link
Contributor

mahkoh commented Jan 8, 2015

This no longer works:

s[i+j..].to_string() // s is a &str

You now have to write

(&s[(i+j)..]).to_string()

At this point using slice_from is more ergonomic.

@mahkoh
Copy link
Contributor Author

mahkoh commented Jan 8, 2015

~$ rustc --version
rustc 1.0.0-dev (9f1ead8fa 2015-01-07 17:45:11 +0000)

@japaric
Copy link
Member

japaric commented Jan 8, 2015

cc @nick29581

@nrc
Copy link
Member

nrc commented Jan 8, 2015

Fixed by #20720

@nrc nrc closed this as completed Jan 8, 2015
@nrc
Copy link
Member

nrc commented Jan 8, 2015

At least the precedence issue.

For everything except str you don't need the (&...), that is a known bug. I'm not sure if there is an issue open for it (@japaric, did you find/open one?). If not let's re-open this one and rename it to make clear the (&...) for str thing

@alexcrichton
Copy link
Member

I think @huonw took care of the rest in #20744.

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

5 participants