Skip to content

list/tuple: rename slice -> get_slice - #1828

Merged
birkenfeld merged 2 commits into
mainfrom
get_slice_rename
Aug 24, 2021
Merged

list/tuple: rename slice -> get_slice#1828
birkenfeld merged 2 commits into
mainfrom
get_slice_rename

Conversation

@birkenfeld

@birkenfeld birkenfeld commented Aug 24, 2021

Copy link
Copy Markdown
Member

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

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

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

birkenfeld commented Aug 24, 2021

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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.)

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, LGTM!

@birkenfeld
birkenfeld enabled auto-merge August 24, 2021 08:31
@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