Skip to content

Commit 10e5e0e

Browse files
authored
Merge pull request #928 from mivort/ord-for-class-name
Derive `Ord` and `PartialOrd` for `ClassName`
2 parents 62bceda + be6a075 commit 10e5e0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

godot-core/src/meta/class_name.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ impl ClassNameSource {
9696
/// This struct is very cheap to copy. The actual names are cached globally.
9797
///
9898
/// If you need to create your own class name, use [`new_cached()`][Self::new_cached].
99-
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
99+
///
100+
/// # Ordering
101+
///
102+
/// `ClassName`s are **not** ordered lexicographically, and the ordering relation is **not** stable across multiple runs of your
103+
/// application. When lexicographical order is needed, it's possible to convert this type to [`GString`] or [`String`].
104+
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
100105
pub struct ClassName {
101106
global_index: u16,
102107
}

0 commit comments

Comments
 (0)