Skip to content

How to remove the Option in generated function pointer? #2919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nomi-san opened this issue Sep 1, 2024 · 1 comment
Closed

How to remove the Option in generated function pointer? #2919

nomi-san opened this issue Sep 1, 2024 · 1 comment

Comments

@nomi-san
Copy link

nomi-san commented Sep 1, 2024

Is there a way to remove the Option<> in the generated code of function pointer member in struct?

Input C/C++ Header

struct Okela {
  int *some_ptr;
  int (*get_some_val)(int a, int b);
};

Actual Results

pub struct Okela {
    pub some_ptr: *mut i32,
    pub get_some_val: ::std::option::Option<
        unsafe extern "C" fn(a: ::std::os::raw::c_int, b: ::std::os::raw::c_int),
    >,
}

Expected Results

...
    pub get_some_val: unsafe extern "C" fn(a: ::std::os::raw::c_int, b: ::std::os::raw::c_int),
@pvdrz
Copy link
Contributor

pvdrz commented Sep 2, 2024

duplicated of #1278

@pvdrz pvdrz closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants