@@ -161,13 +161,13 @@ impl PartialEq<str> for GStr {
161
161
}
162
162
}
163
163
164
- impl < ' a > PartialEq < & ' a str > for GStr {
165
- fn eq ( & self , other : & & ' a str ) -> bool {
164
+ impl PartialEq < & str > for GStr {
165
+ fn eq ( & self , other : & & str ) -> bool {
166
166
self . as_str ( ) == * other
167
167
}
168
168
}
169
169
170
- impl < ' a > PartialEq < GStr > for & ' a str {
170
+ impl PartialEq < GStr > for & str {
171
171
fn eq ( & self , other : & GStr ) -> bool {
172
172
* self == other. as_str ( )
173
173
}
@@ -436,18 +436,21 @@ impl IntoGlibPtr<*mut c_char> for GString {
436
436
}
437
437
438
438
impl Clone for GString {
439
+ #[ inline]
439
440
fn clone ( & self ) -> GString {
440
441
self . as_str ( ) . into ( )
441
442
}
442
443
}
443
444
444
445
impl fmt:: Debug for GString {
446
+ #[ inline]
445
447
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
446
448
<& str as fmt:: Debug >:: fmt ( & self . as_str ( ) , f)
447
449
}
448
450
}
449
451
450
452
impl Drop for GString {
453
+ #[ inline]
451
454
fn drop ( & mut self ) {
452
455
if let Inner :: Foreign { ptr, .. } = self . 0 {
453
456
unsafe {
@@ -458,138 +461,161 @@ impl Drop for GString {
458
461
}
459
462
460
463
impl fmt:: Display for GString {
464
+ #[ inline]
461
465
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
462
466
f. write_str ( self . as_str ( ) )
463
467
}
464
468
}
465
469
466
470
impl hash:: Hash for GString {
471
+ #[ inline]
467
472
fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
468
473
self . as_str ( ) . hash ( state)
469
474
}
470
475
}
471
476
472
477
impl Borrow < GStr > for GString {
478
+ #[ inline]
473
479
fn borrow ( & self ) -> & GStr {
474
480
self . as_gstr ( )
475
481
}
476
482
}
477
483
478
484
impl Borrow < str > for GString {
485
+ #[ inline]
479
486
fn borrow ( & self ) -> & str {
480
487
self . as_str ( )
481
488
}
482
489
}
483
490
484
491
impl Ord for GString {
492
+ #[ inline]
485
493
fn cmp ( & self , other : & GString ) -> Ordering {
486
494
self . as_str ( ) . cmp ( other. as_str ( ) )
487
495
}
488
496
}
489
497
490
498
impl PartialOrd for GString {
499
+ #[ inline]
491
500
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
492
501
Some ( self . cmp ( other) )
493
502
}
494
503
}
495
504
496
505
impl PartialEq for GString {
506
+ #[ inline]
497
507
fn eq ( & self , other : & GString ) -> bool {
498
508
self . as_str ( ) == other. as_str ( )
499
509
}
500
510
}
501
511
502
512
impl PartialEq < GString > for String {
513
+ #[ inline]
503
514
fn eq ( & self , other : & GString ) -> bool {
504
515
self . as_str ( ) == other. as_str ( )
505
516
}
506
517
}
507
518
508
519
impl PartialEq < GStr > for GString {
520
+ #[ inline]
509
521
fn eq ( & self , other : & GStr ) -> bool {
510
522
self . as_str ( ) == other. as_str ( )
511
523
}
512
524
}
513
525
514
526
impl PartialEq < & GStr > for GString {
527
+ #[ inline]
515
528
fn eq ( & self , other : & & GStr ) -> bool {
516
529
self . as_str ( ) == other. as_str ( )
517
530
}
518
531
}
519
532
520
533
impl PartialEq < str > for GString {
534
+ #[ inline]
521
535
fn eq ( & self , other : & str ) -> bool {
522
536
self . as_str ( ) == other
523
537
}
524
538
}
525
539
526
540
impl PartialEq < & str > for GString {
541
+ #[ inline]
527
542
fn eq ( & self , other : & & str ) -> bool {
528
543
self . as_str ( ) == * other
529
544
}
530
545
}
531
546
532
547
impl PartialEq < GString > for & GStr {
548
+ #[ inline]
533
549
fn eq ( & self , other : & GString ) -> bool {
534
550
self . as_str ( ) == other. as_str ( )
535
551
}
536
552
}
537
553
538
554
impl PartialEq < GString > for & str {
555
+ #[ inline]
539
556
fn eq ( & self , other : & GString ) -> bool {
540
557
* self == other. as_str ( )
541
558
}
542
559
}
543
560
544
561
impl PartialEq < String > for GString {
562
+ #[ inline]
545
563
fn eq ( & self , other : & String ) -> bool {
546
564
self . as_str ( ) == other. as_str ( )
547
565
}
548
566
}
549
567
550
568
impl PartialEq < GString > for str {
569
+ #[ inline]
551
570
fn eq ( & self , other : & GString ) -> bool {
552
571
self == other. as_str ( )
553
572
}
554
573
}
555
574
556
575
impl PartialEq < GString > for GStr {
576
+ #[ inline]
557
577
fn eq ( & self , other : & GString ) -> bool {
558
578
self . as_str ( ) == other. as_str ( )
559
579
}
560
580
}
561
581
562
582
impl PartialOrd < GString > for String {
583
+ #[ inline]
563
584
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
564
585
Some ( self . cmp ( & String :: from ( other. as_str ( ) ) ) )
565
586
}
566
587
}
567
588
568
589
impl PartialOrd < String > for GString {
590
+ #[ inline]
569
591
fn partial_cmp ( & self , other : & String ) -> Option < Ordering > {
570
592
Some ( self . as_str ( ) . cmp ( other. as_str ( ) ) )
571
593
}
572
594
}
573
595
574
596
impl PartialOrd < GString > for GStr {
597
+ #[ inline]
575
598
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
576
599
Some ( self . as_str ( ) . cmp ( other) )
577
600
}
578
601
}
579
602
580
603
impl PartialOrd < GStr > for GString {
604
+ #[ inline]
581
605
fn partial_cmp ( & self , other : & GStr ) -> Option < Ordering > {
582
606
Some ( self . as_str ( ) . cmp ( other. as_str ( ) ) )
583
607
}
584
608
}
585
609
586
610
impl PartialOrd < GString > for str {
611
+ #[ inline]
587
612
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
588
613
Some ( self . cmp ( other) )
589
614
}
590
615
}
591
616
592
617
impl PartialOrd < str > for GString {
618
+ #[ inline]
593
619
fn partial_cmp ( & self , other : & str ) -> Option < Ordering > {
594
620
Some ( self . as_str ( ) . cmp ( other) )
595
621
}
@@ -598,12 +624,14 @@ impl PartialOrd<str> for GString {
598
624
impl Eq for GString { }
599
625
600
626
impl AsRef < GStr > for GString {
627
+ #[ inline]
601
628
fn as_ref ( & self ) -> & GStr {
602
629
self . as_gstr ( )
603
630
}
604
631
}
605
632
606
633
impl AsRef < str > for GString {
634
+ #[ inline]
607
635
fn as_ref ( & self ) -> & str {
608
636
self . as_str ( )
609
637
}
@@ -616,18 +644,21 @@ impl AsRef<CStr> for GString {
616
644
}
617
645
618
646
impl AsRef < OsStr > for GString {
647
+ #[ inline]
619
648
fn as_ref ( & self ) -> & OsStr {
620
649
OsStr :: new ( self . as_str ( ) )
621
650
}
622
651
}
623
652
624
653
impl AsRef < Path > for GString {
654
+ #[ inline]
625
655
fn as_ref ( & self ) -> & Path {
626
656
Path :: new ( self . as_str ( ) )
627
657
}
628
658
}
629
659
630
660
impl AsRef < [ u8 ] > for GString {
661
+ #[ inline]
631
662
fn as_ref ( & self ) -> & [ u8 ] {
632
663
self . as_str ( ) . as_bytes ( )
633
664
}
@@ -636,6 +667,7 @@ impl AsRef<[u8]> for GString {
636
667
impl Deref for GString {
637
668
type Target = str ;
638
669
670
+ #[ inline]
639
671
fn deref ( & self ) -> & str {
640
672
self . as_str ( )
641
673
}
@@ -1009,6 +1041,7 @@ impl GlibPtrDefault for GString {
1009
1041
}
1010
1042
1011
1043
impl StaticType for GString {
1044
+ #[ inline]
1012
1045
fn static_type ( ) -> Type {
1013
1046
String :: static_type ( )
1014
1047
}
@@ -1023,22 +1056,26 @@ impl crate::value::ValueTypeOptional for GString {}
1023
1056
unsafe impl < ' a > crate :: value:: FromValue < ' a > for GString {
1024
1057
type Checker = crate :: value:: GenericValueTypeOrNoneChecker < Self > ;
1025
1058
1059
+ #[ inline]
1026
1060
unsafe fn from_value ( value : & ' a Value ) -> Self {
1027
1061
Self :: from ( <& str >:: from_value ( value) )
1028
1062
}
1029
1063
}
1030
1064
1031
1065
impl crate :: value:: ToValue for GString {
1066
+ #[ inline]
1032
1067
fn to_value ( & self ) -> Value {
1033
1068
<& str >:: to_value ( & self . as_str ( ) )
1034
1069
}
1035
1070
1071
+ #[ inline]
1036
1072
fn value_type ( & self ) -> Type {
1037
1073
String :: static_type ( )
1038
1074
}
1039
1075
}
1040
1076
1041
1077
impl crate :: value:: ToValueOptional for GString {
1078
+ #[ inline]
1042
1079
fn to_value_optional ( s : Option < & Self > ) -> Value {
1043
1080
<str >:: to_value_optional ( s. as_ref ( ) . map ( |s| s. as_str ( ) ) )
1044
1081
}
@@ -1055,6 +1092,7 @@ impl From<GString> for Value {
1055
1092
}
1056
1093
1057
1094
impl StaticType for Vec < GString > {
1095
+ #[ inline]
1058
1096
fn static_type ( ) -> Type {
1059
1097
<Vec < String > >:: static_type ( )
1060
1098
}
@@ -1083,6 +1121,7 @@ impl ToValue for Vec<GString> {
1083
1121
}
1084
1122
}
1085
1123
1124
+ #[ inline]
1086
1125
fn value_type ( & self ) -> Type {
1087
1126
<Vec < GString > >:: static_type ( )
1088
1127
}
0 commit comments