r##"#[unsafe(no_mangle)]
pub extern "C" fn Foo_f4(this: *mut Foo, x: CRustOptionusize) -> () {
let mut x: Option<usize> = if x.is_some != 0 {
let mut ret = unsafe { x.val.data };
Some(ret)
} else {
None
};
let this: &Foo = unsafe { this.as_mut().unwrap() };
let mut ret: () = Foo::f4(this, x);
ret
}"##;
r##"#[unsafe(no_mangle)]
pub extern "C" fn Foo_f5(x: CRustOptionf64, y: CRustOptionusize) -> () {
let mut x: Option<f64> = if x.is_some != 0 {
let mut ret = unsafe { x.val.data };
Some(ret)
} else {
None
};
let mut y: Option<usize> = if y.is_some != 0 {
let mut ret = unsafe { y.val.data };
Some(ret)
} else {
None
};
let mut ret: () = Foo::f5(x, y);
ret
}"##;
r##"#[unsafe(no_mangle)]
pub extern "C" fn Foo_f6(x: CRustOptionCRustStrView) -> () {
let mut x: Option<&str> = if x.is_some != 0 {
let mut ret: &str = unsafe {
let slice: &[u8] = ::std::slice::from_raw_parts(
unsafe { x.val.data }.data as *const u8,
unsafe { x.val.data }.len,
);
::std::str::from_utf8_unchecked(slice)
};
Some(ret)
} else {
None
};
let mut ret: () = Foo::f6(x);
ret
}"##;
r##"# [ unsafe ( no_mangle ) ] pub extern "C" fn Foo_f3 ( this : * mut Foo , a0 : CRustOptionu32 , ) -> ( ) {
let mut a0 : Option < ControlItem > = if a0 . is_some != 0 {
let mut ret : ControlItem = < ControlItem >:: swig_from ( unsafe { a0 . val . data } ) ;
Some ( ret ) } else { None } ;
let this : & mut Foo = unsafe { this . as_mut ( ) . unwrap ( ) } ;
let mut ret : ( ) = Foo :: f3 ( this , a0 ) ;
ret }"##;
r##"#[unsafe(no_mangle)]
pub extern "C" fn Foo_f7(x: CRustClassOptBoo) -> () {
let mut x: Option<&Boo> = if !x.p.is_null() {
assert!(!x.p.is_null());
let obj: &Boo = unsafe { &*(x.p as *const Boo) };
Some(obj)
} else {
None
};
let mut ret: () = Foo::f7(x);
ret
}"##;