2
2
3
3
use std:: { ffi:: c_char, fmt, marker:: PhantomData , mem, ptr} ;
4
4
5
- use crate :: { translate:: * , GStr , GStrPtr , GString } ;
5
+ use crate :: { translate:: * , GStr , GString , GStringPtr } ;
6
6
7
7
// rustdoc-stripper-ignore-next
8
8
/// Minimum size of the `StrV` allocation.
@@ -100,25 +100,25 @@ impl Default for StrV {
100
100
}
101
101
}
102
102
103
- impl AsRef < [ GStrPtr ] > for StrV {
103
+ impl AsRef < [ GStringPtr ] > for StrV {
104
104
#[ inline]
105
- fn as_ref ( & self ) -> & [ GStrPtr ] {
105
+ fn as_ref ( & self ) -> & [ GStringPtr ] {
106
106
self . as_slice ( )
107
107
}
108
108
}
109
109
110
- impl std:: borrow:: Borrow < [ GStrPtr ] > for StrV {
110
+ impl std:: borrow:: Borrow < [ GStringPtr ] > for StrV {
111
111
#[ inline]
112
- fn borrow ( & self ) -> & [ GStrPtr ] {
112
+ fn borrow ( & self ) -> & [ GStringPtr ] {
113
113
self . as_slice ( )
114
114
}
115
115
}
116
116
117
117
impl std:: ops:: Deref for StrV {
118
- type Target = [ GStrPtr ] ;
118
+ type Target = [ GStringPtr ] ;
119
119
120
120
#[ inline]
121
- fn deref ( & self ) -> & [ GStrPtr ] {
121
+ fn deref ( & self ) -> & [ GStringPtr ] {
122
122
self . as_slice ( )
123
123
}
124
124
}
@@ -160,8 +160,8 @@ impl std::iter::FromIterator<GString> for StrV {
160
160
}
161
161
162
162
impl < ' a > std:: iter:: IntoIterator for & ' a StrV {
163
- type Item = & ' a GStrPtr ;
164
- type IntoIter = std:: slice:: Iter < ' a , GStrPtr > ;
163
+ type Item = & ' a GStringPtr ;
164
+ type IntoIter = std:: slice:: Iter < ' a , GStringPtr > ;
165
165
166
166
#[ inline]
167
167
fn into_iter ( self ) -> Self :: IntoIter {
@@ -201,12 +201,12 @@ impl IntoIter {
201
201
// rustdoc-stripper-ignore-next
202
202
/// Returns the remaining items as slice.
203
203
#[ inline]
204
- pub fn as_slice ( & self ) -> & [ GStrPtr ] {
204
+ pub fn as_slice ( & self ) -> & [ GStringPtr ] {
205
205
unsafe {
206
206
if self . len == 0 {
207
207
& [ ]
208
208
} else {
209
- std:: slice:: from_raw_parts ( self . idx . as_ptr ( ) as * const GStrPtr , self . len )
209
+ std:: slice:: from_raw_parts ( self . idx . as_ptr ( ) as * const GStringPtr , self . len )
210
210
}
211
211
}
212
212
}
@@ -407,7 +407,7 @@ impl StrV {
407
407
// rustdoc-stripper-ignore-next
408
408
/// Borrows a C array.
409
409
#[ inline]
410
- pub unsafe fn from_glib_borrow < ' a > ( ptr : * const * const c_char ) -> & ' a [ GStrPtr ] {
410
+ pub unsafe fn from_glib_borrow < ' a > ( ptr : * const * const c_char ) -> & ' a [ GStringPtr ] {
411
411
let mut len = 0 ;
412
412
if !ptr. is_null ( ) {
413
413
while !( * ptr. add ( len) ) . is_null ( ) {
@@ -420,13 +420,16 @@ impl StrV {
420
420
// rustdoc-stripper-ignore-next
421
421
/// Borrows a C array.
422
422
#[ inline]
423
- pub unsafe fn from_glib_borrow_num < ' a > ( ptr : * const * const c_char , len : usize ) -> & ' a [ GStrPtr ] {
423
+ pub unsafe fn from_glib_borrow_num < ' a > (
424
+ ptr : * const * const c_char ,
425
+ len : usize ,
426
+ ) -> & ' a [ GStringPtr ] {
424
427
debug_assert ! ( !ptr. is_null( ) || len == 0 ) ;
425
428
426
429
if len == 0 {
427
430
& [ ]
428
431
} else {
429
- std:: slice:: from_raw_parts ( ptr as * const GStrPtr , len)
432
+ std:: slice:: from_raw_parts ( ptr as * const GStringPtr , len)
430
433
}
431
434
}
432
435
@@ -675,14 +678,14 @@ impl StrV {
675
678
}
676
679
677
680
// rustdoc-stripper-ignore-next
678
- /// Borrows this slice as a `&[GStrPtr ]`.
681
+ /// Borrows this slice as a `&[GStringPtr ]`.
679
682
#[ inline]
680
- pub fn as_slice ( & self ) -> & [ GStrPtr ] {
683
+ pub fn as_slice ( & self ) -> & [ GStringPtr ] {
681
684
unsafe {
682
685
if self . len == 0 {
683
686
& [ ]
684
687
} else {
685
- std:: slice:: from_raw_parts ( self . ptr . as_ptr ( ) as * const GStrPtr , self . len )
688
+ std:: slice:: from_raw_parts ( self . ptr . as_ptr ( ) as * const GStringPtr , self . len )
686
689
}
687
690
}
688
691
}
@@ -948,7 +951,7 @@ impl crate::StaticType for StrV {
948
951
}
949
952
}
950
953
951
- impl < ' a > crate :: StaticType for & ' a [ GStrPtr ] {
954
+ impl < ' a > crate :: StaticType for & ' a [ GStringPtr ] {
952
955
#[ inline]
953
956
fn static_type ( ) -> crate :: Type {
954
957
<Vec < String > >:: static_type ( )
@@ -968,7 +971,7 @@ unsafe impl<'a> crate::value::FromValue<'a> for StrV {
968
971
}
969
972
}
970
973
971
- unsafe impl < ' a > crate :: value:: FromValue < ' a > for & ' a [ GStrPtr ] {
974
+ unsafe impl < ' a > crate :: value:: FromValue < ' a > for & ' a [ GStringPtr ] {
972
975
type Checker = crate :: value:: GenericValueTypeChecker < Self > ;
973
976
974
977
unsafe fn from_value ( value : & ' a crate :: value:: Value ) -> Self {
0 commit comments