Skip to content

Commit

Permalink
Remove all nightly features
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Jun 29, 2024
1 parent 3f4b484 commit 5f2fb98
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions crates/components/src/id_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ where
F: Fn(usize) -> String,
{
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
if self.search_needs_update && !self.reference.is_sorted() {
if self.search_needs_update && luminol_core::slice_is_sorted(self.reference) {
self.reference.sort_unstable();
}

Expand Down Expand Up @@ -304,10 +304,10 @@ where
{
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
if self.search_needs_update {
if !self.plus.is_sorted() {
if !luminol_core::slice_is_sorted(self.plus) {
self.plus.sort_unstable();
}
if !self.minus.is_sorted() {
if !luminol_core::slice_is_sorted(self.minus) {
self.minus.sort_unstable();
}
}
Expand Down
1 change: 0 additions & 1 deletion crates/components/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// terms of the Steamworks API by Valve Corporation, the licensors of this
// Program grant you additional permission to convey the resulting work.
#![cfg_attr(target_arch = "wasm32", allow(clippy::arc_with_non_send_sync))]
#![feature(is_sorted)]

use itertools::Itertools;

Expand Down
7 changes: 7 additions & 0 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,10 @@ impl<'res> UpdateState<'res> {
self.modified.set(false);
}
}

pub fn slice_is_sorted<T: Ord>(s: &[T]) -> bool {
s.windows(2).all(|w| {
let [a, b] = w else { unreachable!() }; // could maybe do unreachable_unchecked
a <= b
})
}
1 change: 0 additions & 1 deletion crates/data/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(min_specialization)]
#![allow(non_upper_case_globals)]

// Editor specific types
Expand Down
1 change: 0 additions & 1 deletion crates/ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// it with Steamworks API by Valve Corporation, containing parts covered by
// terms of the Steamworks API by Valve Corporation, the licensors of this
// Program grant you additional permission to convey the resulting work.
#![feature(is_sorted)]

pub type UpdateState<'res> = luminol_core::UpdateState<'res>;

Expand Down
4 changes: 2 additions & 2 deletions crates/ui/src/windows/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ impl luminol_core::Window for Window {
});

if let Some(class) = classes.data.get_mut(actor.class_id) {
if !class.weapon_set.is_sorted() {
if !luminol_core::slice_is_sorted(&class.weapon_set) {
class.weapon_set.sort_unstable();
}
if !class.armor_set.is_sorted() {
if !luminol_core::slice_is_sorted(&class.armor_set) {
class.armor_set.sort_unstable();
}
}
Expand Down

0 comments on commit 5f2fb98

Please sign in to comment.