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

Remove Deref bounds from containers #416

Closed
wants to merge 1 commit into from

Conversation

frankmcsherry
Copy link
Member

This PR replaces a pervasive Deref bound on containers with index and len methods, and reworks copy_slice into copy_range. Now that I type it, we could probably keep copy_slice, as implementing it is not hard (rather dereferencing to form the input slice).

Ideally we would use std::ops::Index but this makes life terrible when we elsewhere write container[..] or the like to get a slice, and instead run afoul of .. not being a usize for the Index implementation. Perhaps this could be cleaned up and made more pleasant before landing.

cc: @antiguru

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.

1 participant