Skip to content

Implement Clone::clone_from for BitVec#246

Open
willcrichton wants to merge 1 commit intoferrilab:mainfrom
willcrichton:main
Open

Implement Clone::clone_from for BitVec#246
willcrichton wants to merge 1 commit intoferrilab:mainfrom
willcrichton:main

Conversation

@willcrichton
Copy link

The default implementation of clone_from is just *self = other.clone(), which involves an unnecessary allocation if self.len() == other.len(). This PR provides a Clone::clone_from implementation that calls copy_from_bitslice when applicable.

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