summaryrefslogtreecommitdiff
path: root/engine/src/lazysort.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/lazysort.rs')
-rw-r--r--engine/src/lazysort.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/engine/src/lazysort.rs b/engine/src/lazysort.rs
index e2d6a3f..bec372c 100644
--- a/engine/src/lazysort.rs
+++ b/engine/src/lazysort.rs
@@ -10,10 +10,10 @@ pub struct LazySortIter<T, F: Fn(&T) -> R, R: Ord> {
index: usize,
}
-impl<T, F: Fn(&T) -> R, R: Ord> LazySort<T, F, R> {
- pub fn new(collection: Box<[T]>, sort_by: F) -> Self {
+impl<T: Clone, F: Fn(&T) -> R, R: Ord> LazySort<T, F, R> {
+ pub fn new(collection: &[T], sort_by: F) -> Self {
Self {
- collection,
+ collection: collection.into(),
sort_by,
sorted: 0,
}