We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Are there any performance issues that may arise from using the following extension methods?
pub trait AsImVec<A: Clone>: Clone { fn push_back(&mut self, value: A); fn to_pushed_back(&self, value: A) -> Self { let mut new = self.clone(); new.push_back(value); new } fn push_front(&mut self, value: A); fn to_pushed_front(&self, value: A) -> Self { let mut new = self.clone(); new.push_front(value); new } fn sort_by<F: Fn(&A, &A) -> std::cmp::Ordering>(&mut self, cmp: F); fn to_sorted_by<F: Fn(&A, &A) -> std::cmp::Ordering>(&self, cmp: F) -> Self { let mut new = self.clone(); new.sort_by(cmp); new } fn insert(&mut self, index: usize, value: A); fn to_inserted(&mut self, index: usize, value: A) -> Self { let mut new = self.clone(); new.insert(index, value); new } } impl<A: Clone> AsImVec<A> for im_rc::Vector<A> { fn push_back(&mut self, value: A) { self.push_back(value) } fn push_front(&mut self, value: A) { self.push_front(value) } fn sort_by<F: Fn(&A, &A) -> std::cmp::Ordering>(&mut self, cmp: F) { self.sort_by(cmp) } fn insert(&mut self, index: usize, value: A) { self.insert(index, value) } } impl<A: Clone> AsImVec<A> for im::Vector<A> { fn push_back(&mut self, value: A) { self.push_back(value) } fn push_front(&mut self, value: A) { self.push_front(value) } fn sort_by<F: Fn(&A, &A) -> std::cmp::Ordering>(&mut self, cmp: F) { self.sort_by(cmp) } fn insert(&mut self, index: usize, value: A) { self.insert(index, value) } }
In this repo.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Are there any performance issues that may arise from using the following extension methods?
In this repo.
The text was updated successfully, but these errors were encountered: