summaryrefslogtreecommitdiffstats
path: root/ffi-macros/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ffi-macros/src/lib.rs')
-rw-r--r--ffi-macros/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ffi-macros/src/lib.rs b/ffi-macros/src/lib.rs
index 0a1efc1d..6eebc9a3 100644
--- a/ffi-macros/src/lib.rs
+++ b/ffi-macros/src/lib.rs
@@ -258,8 +258,8 @@ pub fn ffi_wrapper_type(args: TokenStream, input: TokenStream) -> TokenStream {
}
let wrapper = st.ident.clone();
- let name = name.unwrap_or(ident2c(&st.ident));
- let prefix = prefix.unwrap_or("".into());
+ let name = name.unwrap_or_else(|| ident2c(&st.ident));
+ let prefix = prefix.unwrap_or_else(|| "".into());
// Parse the type of the wrapped object.
let argument_span = st.fields.span();