gtk-rs / gir

Tool to generate rust bindings and user API for glib-based libraries
https://gtk-rs.org/gir/book/
MIT License
230 stars 102 forks source link

Use collection types for return values #1447

Open jf2048 opened 1 year ago

jf2048 commented 1 year ago

Is there a better way to get the actual type of a C array from the builder? The best I could do is adding the c_type like this.

I left the Vec<OsString> and Vec<PathBuf> return as is, since those require allocations and they are opt-in.

sdroege commented 1 year ago

Can you make a draft PR with the changes this causes in the generated code?

sdroege commented 1 year ago

What also might be worth considering here is parameters.

This might also be something to handle in a separate PR though.

jf2048 commented 1 year ago

Those should be handled in #1448

sdroege commented 1 year ago

Those should be handled in https://github.com/gtk-rs/gir/pull/1448

The first two fit more here or in a separate PR, or not? #1448 is string stuff, this here is collections :) The third one fits better in #1448 though, that's true.

sdroege commented 1 year ago

Looks good to me otherwise, if that wasn't clear. How should we proceed? :)

jf2048 commented 1 year ago

Sorry for delay, I did some more testing and this is looking good for me too. But I think this situation should be resolved first: https://github.com/gtk-rs/gtk-rs-core/pull/1078