File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
gdnative-core/src/core_types Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -542,6 +542,12 @@ impl fmt::Debug for Utf8String {
542
542
}
543
543
}
544
544
545
+ /// Interned string.
546
+ ///
547
+ /// Like [`GodotString`], but unique: two `StringName`s with the same string value share the same
548
+ /// internal object. Just like the `GodotString` struct, this type is immutable.
549
+ ///
550
+ /// Use [`Self::from_godot_string()`] and [`Self::to_godot_string()`] for conversions.
545
551
pub struct StringName ( pub ( crate ) sys:: godot_string_name ) ;
546
552
547
553
impl StringName {
@@ -579,15 +585,10 @@ impl StringName {
579
585
}
580
586
581
587
#[ inline]
582
- pub fn get_name ( & self ) -> GodotString {
588
+ pub fn to_godot_string ( & self ) -> GodotString {
583
589
unsafe { GodotString ( ( get_api ( ) . godot_string_name_get_name ) ( & self . 0 ) ) }
584
590
}
585
591
586
- #[ inline]
587
- pub fn operator_less ( & self , s : & StringName ) -> bool {
588
- unsafe { ( get_api ( ) . godot_string_name_operator_less ) ( & self . 0 , & s. 0 ) }
589
- }
590
-
591
592
#[ doc( hidden) ]
592
593
#[ inline]
593
594
pub fn sys ( & self ) -> * const sys:: godot_string_name {
@@ -617,7 +618,7 @@ impl_basic_traits_as_sys! {
617
618
impl fmt:: Debug for StringName {
618
619
#[ inline]
619
620
fn fmt ( & self , f : & mut fmt:: Formatter ) -> Result < ( ) , fmt:: Error > {
620
- self . get_name ( ) . to_string ( ) . fmt ( f)
621
+ self . to_godot_string ( ) . fmt ( f)
621
622
}
622
623
}
623
624
You can’t perform that action at this time.
0 commit comments