luaur_analysis/functions/
get_2.rs1use crate::functions::get_type_utils::get_optional_ty;
5use crate::records::try_pair::TryPair;
6
7pub fn get2<A, B, Ty>(one: Ty, two: Ty) -> TryPair<*const A, *const B>
9where
10 A: crate::functions::get_type_utils::GetThroughId<Ty>,
11 B: crate::functions::get_type_utils::GetThroughId<Ty>,
12 Ty: Copy,
13{
14 let a = unsafe { get_optional_ty::<A, Ty>(Some(one)) };
15 let b = unsafe { get_optional_ty::<B, Ty>(Some(two)) };
16
17 if !a.is_null() && !b.is_null() {
18 TryPair {
19 first: a,
20 second: b,
21 }
22 } else {
23 TryPair {
24 first: core::ptr::null(),
25 second: core::ptr::null(),
26 }
27 }
28}