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

list/tuple: rename slice -> get_slice #1828

Merged
merged 2 commits into from
Aug 24, 2021
Merged

list/tuple: rename slice -> get_slice #1828

merged 2 commits into from
Aug 24, 2021

Conversation

birkenfeld
Copy link
Member

@birkenfeld birkenfeld commented Aug 24, 2021

Only tuple's method is renamed; list's method is a new API in 0.15.

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

👍 I 100% agree with doing this!

Can you please re-add .slice() as a deprecated API for one release cycle? It makes it easier for users to upgrade their code.

@birkenfeld
Copy link
Member Author

birkenfeld commented Aug 24, 2021

So, should the deprecated method continue to use isize indices as in 0.14? Otherwise, people will get a compile error instead of a deprecation warning anyway... (ok, not in all cases.)

@davidhewitt
Copy link
Member

Oooh good question! I think the original isize implementation is probably best? (Could potentially even copy it from 0.14 rather than try to implement it using the new APIs, for maximum backcompat.)

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@birkenfeld birkenfeld merged commit 3bed782 into main Aug 24, 2021
@messense messense deleted the get_slice_rename branch August 24, 2021 08:39
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.

2 participants