diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-06 19:58:21 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-09 13:13:58 +0200 |
commit | 9424cd350f32a97479a74d919c646f9e26c2ebce (patch) | |
tree | e7b62ae2693ccbcb73d74cacabbf6c9a31a4552e /ffi-macros | |
parent | ec5129c0863962dd3ee32b6af29be45d4d979193 (diff) |
Lint: Use lazy evaluation.
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
Diffstat (limited to 'ffi-macros')
-rw-r--r-- | ffi-macros/src/lib.rs | 4 |
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(); |