@@ -186,13 +186,13 @@ impl PartialEq<str> for GStr {
186
186
}
187
187
}
188
188
189
- impl < ' a > PartialEq < & ' a str > for GStr {
190
- fn eq ( & self , other : & & ' a str ) -> bool {
189
+ impl PartialEq < & str > for GStr {
190
+ fn eq ( & self , other : & & str ) -> bool {
191
191
self . as_str ( ) == * other
192
192
}
193
193
}
194
194
195
- impl < ' a > PartialEq < GStr > for & ' a str {
195
+ impl PartialEq < GStr > for & str {
196
196
fn eq ( & self , other : & GStr ) -> bool {
197
197
* self == other. as_str ( )
198
198
}
@@ -485,18 +485,21 @@ impl IntoGlibPtr<*mut c_char> for GString {
485
485
}
486
486
487
487
impl Clone for GString {
488
+ #[ inline]
488
489
fn clone ( & self ) -> GString {
489
490
self . as_str ( ) . into ( )
490
491
}
491
492
}
492
493
493
494
impl fmt:: Debug for GString {
495
+ #[ inline]
494
496
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
495
497
<& str as fmt:: Debug >:: fmt ( & self . as_str ( ) , f)
496
498
}
497
499
}
498
500
499
501
impl Drop for GString {
502
+ #[ inline]
500
503
fn drop ( & mut self ) {
501
504
if let Inner :: Foreign { ptr, .. } = self . 0 {
502
505
unsafe {
@@ -507,138 +510,161 @@ impl Drop for GString {
507
510
}
508
511
509
512
impl fmt:: Display for GString {
513
+ #[ inline]
510
514
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
511
515
f. write_str ( self . as_str ( ) )
512
516
}
513
517
}
514
518
515
519
impl hash:: Hash for GString {
520
+ #[ inline]
516
521
fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
517
522
self . as_str ( ) . hash ( state)
518
523
}
519
524
}
520
525
521
526
impl Borrow < GStr > for GString {
527
+ #[ inline]
522
528
fn borrow ( & self ) -> & GStr {
523
529
self . as_gstr ( )
524
530
}
525
531
}
526
532
527
533
impl Borrow < str > for GString {
534
+ #[ inline]
528
535
fn borrow ( & self ) -> & str {
529
536
self . as_str ( )
530
537
}
531
538
}
532
539
533
540
impl Ord for GString {
541
+ #[ inline]
534
542
fn cmp ( & self , other : & GString ) -> Ordering {
535
543
self . as_str ( ) . cmp ( other. as_str ( ) )
536
544
}
537
545
}
538
546
539
547
impl PartialOrd for GString {
548
+ #[ inline]
540
549
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
541
550
Some ( self . cmp ( other) )
542
551
}
543
552
}
544
553
545
554
impl PartialEq for GString {
555
+ #[ inline]
546
556
fn eq ( & self , other : & GString ) -> bool {
547
557
self . as_str ( ) == other. as_str ( )
548
558
}
549
559
}
550
560
551
561
impl PartialEq < GString > for String {
562
+ #[ inline]
552
563
fn eq ( & self , other : & GString ) -> bool {
553
564
self . as_str ( ) == other. as_str ( )
554
565
}
555
566
}
556
567
557
568
impl PartialEq < GStr > for GString {
569
+ #[ inline]
558
570
fn eq ( & self , other : & GStr ) -> bool {
559
571
self . as_str ( ) == other. as_str ( )
560
572
}
561
573
}
562
574
563
575
impl PartialEq < & GStr > for GString {
576
+ #[ inline]
564
577
fn eq ( & self , other : & & GStr ) -> bool {
565
578
self . as_str ( ) == other. as_str ( )
566
579
}
567
580
}
568
581
569
582
impl PartialEq < str > for GString {
583
+ #[ inline]
570
584
fn eq ( & self , other : & str ) -> bool {
571
585
self . as_str ( ) == other
572
586
}
573
587
}
574
588
575
589
impl PartialEq < & str > for GString {
590
+ #[ inline]
576
591
fn eq ( & self , other : & & str ) -> bool {
577
592
self . as_str ( ) == * other
578
593
}
579
594
}
580
595
581
596
impl PartialEq < GString > for & GStr {
597
+ #[ inline]
582
598
fn eq ( & self , other : & GString ) -> bool {
583
599
self . as_str ( ) == other. as_str ( )
584
600
}
585
601
}
586
602
587
603
impl PartialEq < GString > for & str {
604
+ #[ inline]
588
605
fn eq ( & self , other : & GString ) -> bool {
589
606
* self == other. as_str ( )
590
607
}
591
608
}
592
609
593
610
impl PartialEq < String > for GString {
611
+ #[ inline]
594
612
fn eq ( & self , other : & String ) -> bool {
595
613
self . as_str ( ) == other. as_str ( )
596
614
}
597
615
}
598
616
599
617
impl PartialEq < GString > for str {
618
+ #[ inline]
600
619
fn eq ( & self , other : & GString ) -> bool {
601
620
self == other. as_str ( )
602
621
}
603
622
}
604
623
605
624
impl PartialEq < GString > for GStr {
625
+ #[ inline]
606
626
fn eq ( & self , other : & GString ) -> bool {
607
627
self . as_str ( ) == other. as_str ( )
608
628
}
609
629
}
610
630
611
631
impl PartialOrd < GString > for String {
632
+ #[ inline]
612
633
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
613
634
Some ( self . cmp ( & String :: from ( other. as_str ( ) ) ) )
614
635
}
615
636
}
616
637
617
638
impl PartialOrd < String > for GString {
639
+ #[ inline]
618
640
fn partial_cmp ( & self , other : & String ) -> Option < Ordering > {
619
641
Some ( self . as_str ( ) . cmp ( other. as_str ( ) ) )
620
642
}
621
643
}
622
644
623
645
impl PartialOrd < GString > for GStr {
646
+ #[ inline]
624
647
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
625
648
Some ( self . as_str ( ) . cmp ( other) )
626
649
}
627
650
}
628
651
629
652
impl PartialOrd < GStr > for GString {
653
+ #[ inline]
630
654
fn partial_cmp ( & self , other : & GStr ) -> Option < Ordering > {
631
655
Some ( self . as_str ( ) . cmp ( other. as_str ( ) ) )
632
656
}
633
657
}
634
658
635
659
impl PartialOrd < GString > for str {
660
+ #[ inline]
636
661
fn partial_cmp ( & self , other : & GString ) -> Option < Ordering > {
637
662
Some ( self . cmp ( other) )
638
663
}
639
664
}
640
665
641
666
impl PartialOrd < str > for GString {
667
+ #[ inline]
642
668
fn partial_cmp ( & self , other : & str ) -> Option < Ordering > {
643
669
Some ( self . as_str ( ) . cmp ( other) )
644
670
}
@@ -647,12 +673,14 @@ impl PartialOrd<str> for GString {
647
673
impl Eq for GString { }
648
674
649
675
impl AsRef < GStr > for GString {
676
+ #[ inline]
650
677
fn as_ref ( & self ) -> & GStr {
651
678
self . as_gstr ( )
652
679
}
653
680
}
654
681
655
682
impl AsRef < str > for GString {
683
+ #[ inline]
656
684
fn as_ref ( & self ) -> & str {
657
685
self . as_str ( )
658
686
}
@@ -665,18 +693,21 @@ impl AsRef<CStr> for GString {
665
693
}
666
694
667
695
impl AsRef < OsStr > for GString {
696
+ #[ inline]
668
697
fn as_ref ( & self ) -> & OsStr {
669
698
OsStr :: new ( self . as_str ( ) )
670
699
}
671
700
}
672
701
673
702
impl AsRef < Path > for GString {
703
+ #[ inline]
674
704
fn as_ref ( & self ) -> & Path {
675
705
Path :: new ( self . as_str ( ) )
676
706
}
677
707
}
678
708
679
709
impl AsRef < [ u8 ] > for GString {
710
+ #[ inline]
680
711
fn as_ref ( & self ) -> & [ u8 ] {
681
712
self . as_str ( ) . as_bytes ( )
682
713
}
@@ -685,6 +716,7 @@ impl AsRef<[u8]> for GString {
685
716
impl Deref for GString {
686
717
type Target = str ;
687
718
719
+ #[ inline]
688
720
fn deref ( & self ) -> & str {
689
721
self . as_str ( )
690
722
}
@@ -1070,6 +1102,7 @@ impl GlibPtrDefault for GString {
1070
1102
}
1071
1103
1072
1104
impl StaticType for GString {
1105
+ #[ inline]
1073
1106
fn static_type ( ) -> Type {
1074
1107
String :: static_type ( )
1075
1108
}
@@ -1084,22 +1117,26 @@ impl crate::value::ValueTypeOptional for GString {}
1084
1117
unsafe impl < ' a > crate :: value:: FromValue < ' a > for GString {
1085
1118
type Checker = crate :: value:: GenericValueTypeOrNoneChecker < Self > ;
1086
1119
1120
+ #[ inline]
1087
1121
unsafe fn from_value ( value : & ' a Value ) -> Self {
1088
1122
Self :: from ( <& str >:: from_value ( value) )
1089
1123
}
1090
1124
}
1091
1125
1092
1126
impl crate :: value:: ToValue for GString {
1127
+ #[ inline]
1093
1128
fn to_value ( & self ) -> Value {
1094
1129
<& str >:: to_value ( & self . as_str ( ) )
1095
1130
}
1096
1131
1132
+ #[ inline]
1097
1133
fn value_type ( & self ) -> Type {
1098
1134
String :: static_type ( )
1099
1135
}
1100
1136
}
1101
1137
1102
1138
impl crate :: value:: ToValueOptional for GString {
1139
+ #[ inline]
1103
1140
fn to_value_optional ( s : Option < & Self > ) -> Value {
1104
1141
<str >:: to_value_optional ( s. as_ref ( ) . map ( |s| s. as_str ( ) ) )
1105
1142
}
@@ -1116,6 +1153,7 @@ impl From<GString> for Value {
1116
1153
}
1117
1154
1118
1155
impl StaticType for Vec < GString > {
1156
+ #[ inline]
1119
1157
fn static_type ( ) -> Type {
1120
1158
<Vec < String > >:: static_type ( )
1121
1159
}
@@ -1144,6 +1182,7 @@ impl ToValue for Vec<GString> {
1144
1182
}
1145
1183
}
1146
1184
1185
+ #[ inline]
1147
1186
fn value_type ( & self ) -> Type {
1148
1187
<Vec < GString > >:: static_type ( )
1149
1188
}
0 commit comments