Compare commits

...

2 commits

Author SHA1 Message Date
05cf805c03 Suppress some clippy warnings for ffi module
No need to heed clippy warnings on code automatically generated by
bindgen.
2024-03-18 16:37:40 +09:00
6e2e67f086 Refactor macro
More minor refactoring of macro introduced 3 commits ago.
2024-03-18 16:35:25 +09:00
2 changed files with 5 additions and 3 deletions

View file

@ -3,6 +3,8 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
#![allow(unused_imports)] #![allow(unused_imports)]
#![allow(dead_code)] #![allow(dead_code)]
#![allow(clippy::complexity)]
#![allow(clippy::style)]
include!(concat!(env!("OUT_DIR"), "/glfw_vk_bindings.rs")); include!(concat!(env!("OUT_DIR"), "/glfw_vk_bindings.rs"));
pub fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 { pub fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 {

View file

@ -6,15 +6,15 @@ macro_rules! cleanup_func {
$(var_pair: $orig_var:expr, $new_var:ident),*) => { $(var_pair: $orig_var:expr, $new_var:ident),*) => {
$(let $new_var = $orig_var;)* $(let $new_var = $orig_var;)*
struct $name <T: Fn() -> ()> { struct $name <T: Fn()> {
func: T, func: T,
} }
impl<T> Drop for $name <T> where T: Fn() -> () { impl<T> Drop for $name <T> where T: Fn() {
fn drop(&mut self) { fn drop(&mut self) {
(self.func)(); (self.func)();
} }
} }
impl<T> $name <T> where T: Fn() -> () { impl<T> $name <T> where T: Fn() {
fn new(func: T) -> Self { fn new(func: T) -> Self {
Self { Self {
func, func,