diff options
| author | Micha White <botahamec@outlook.com> | 2023-12-21 16:33:09 -0500 |
|---|---|---|
| committer | Micha White <botahamec@outlook.com> | 2023-12-21 16:33:09 -0500 |
| commit | 207bafde1fa2468d666c7ac894eebee1cf95bed2 (patch) | |
| tree | 454dcd095a5ad0d5230799055da92bb35e43db3d /engine/src/lazysort.rs | |
| parent | e4be2bdb76842e34503c2a408ab7cffdc30d4ec2 (diff) | |
Engine API
Diffstat (limited to 'engine/src/lazysort.rs')
| -rw-r--r-- | engine/src/lazysort.rs | 6 |
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, } |
