Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 667635d

Browse files
authored
Merge pull request #692 from sdroege/remove-garray-ffi
Remove GArray FFI translation impls
2 parents ea407a5 + 76d7fc0 commit 667635d

File tree

1 file changed

+0
-82
lines changed

1 file changed

+0
-82
lines changed

src/translate.rs

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -981,88 +981,6 @@ impl Drop for HashTable {
981981
}
982982
}
983983

984-
impl<'a, T> ToGlibContainerFromSlice<'a, *const glib_sys::GArray> for &'a T
985-
where
986-
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
987-
{
988-
type Storage = (
989-
Option<Array>,
990-
Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, &'a T>>,
991-
);
992-
993-
#[inline]
994-
fn to_glib_none_from_slice(t: &'a [&'a T]) -> (*const glib_sys::GArray, Self::Storage) {
995-
let (list, stash) =
996-
ToGlibContainerFromSlice::<*mut glib_sys::GArray>::to_glib_none_from_slice(t);
997-
(list as *const glib_sys::GArray, stash)
998-
}
999-
1000-
#[inline]
1001-
fn to_glib_container_from_slice(_t: &'a [&'a T]) -> (*const glib_sys::GArray, Self::Storage) {
1002-
unimplemented!()
1003-
}
1004-
1005-
#[inline]
1006-
fn to_glib_full_from_slice(_t: &[&'a T]) -> *const glib_sys::GArray {
1007-
unimplemented!()
1008-
}
1009-
}
1010-
1011-
pub struct Array(*mut glib_sys::GArray);
1012-
1013-
impl Drop for Array {
1014-
fn drop(&mut self) {
1015-
unsafe {
1016-
glib_sys::g_array_unref(self.0);
1017-
}
1018-
}
1019-
}
1020-
1021-
impl<'a, T> ToGlibContainerFromSlice<'a, *mut glib_sys::GArray> for T
1022-
where
1023-
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
1024-
{
1025-
type Storage = (
1026-
Option<Array>,
1027-
Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>,
1028-
);
1029-
1030-
#[inline]
1031-
fn to_glib_none_from_slice(t: &'a [T]) -> (*mut glib_sys::GArray, Self::Storage) {
1032-
let stash_vec: Vec<_> = t.iter().map(ToGlibPtr::to_glib_none).collect();
1033-
let mut arr: *mut glib_sys::GArray = ptr::null_mut();
1034-
unsafe {
1035-
for stash in &stash_vec {
1036-
arr = glib_sys::g_array_append_vals(arr, Ptr::to(stash.0), 1);
1037-
}
1038-
}
1039-
(arr, (Some(Array(arr)), stash_vec))
1040-
}
1041-
1042-
#[inline]
1043-
fn to_glib_container_from_slice(t: &'a [T]) -> (*mut glib_sys::GArray, Self::Storage) {
1044-
let stash_vec: Vec<_> = t.iter().rev().map(ToGlibPtr::to_glib_none).collect();
1045-
let mut arr: *mut glib_sys::GArray = ptr::null_mut();
1046-
unsafe {
1047-
for stash in &stash_vec {
1048-
arr = glib_sys::g_array_append_vals(arr, Ptr::to(stash.0), 1);
1049-
}
1050-
}
1051-
(arr, (None, stash_vec))
1052-
}
1053-
1054-
#[inline]
1055-
fn to_glib_full_from_slice(t: &[T]) -> *mut glib_sys::GArray {
1056-
let mut arr: *mut glib_sys::GArray = ptr::null_mut();
1057-
unsafe {
1058-
for ptr in t.iter().map(ToGlibPtr::to_glib_full) {
1059-
arr = glib_sys::g_array_append_vals(arr, Ptr::to(ptr), 1);
1060-
}
1061-
}
1062-
arr
1063-
}
1064-
}
1065-
1066984
pub struct PtrArray(*mut glib_sys::GPtrArray);
1067985

1068986
impl Drop for PtrArray {

0 commit comments

Comments
 (0)