milkey-mouse / planets

A space game.
GNU General Public License v3.0
3 stars 1 forks source link

prefer() function for best available choice #6

Closed todo[bot] closed 5 years ago

todo[bot] commented 5 years ago

it would be something like this: `fn prefer<'a, T>(wanted: Iterable<&T>, supported: Iterable<&T>, default_to_first: bool) -> Option<&'a T>` we can replace some of the queue_family, format, present_mode, etc. selection logic with this fn. the lifetime annotations in the above signature may be unnecessary; I don't know Rust well enough to know without a `cargo check`


https://github.com/milkey-mouse/planets/blob/71d957a2893b87a0341a566c3ee399b2af3acb37/src/main.rs#L115-L120


This issue was generated by todo based on a // TODO: comment in 71d957a2893b87a0341a566c3ee399b2af3acb37. It's been assigned to @milkey-mouse because they committed the code.