diff options
author | MikuroXina <ryosukadnak@gmail.com> | 2021-10-25 22:06:54 +0900 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2021-10-27 19:22:15 +0200 |
commit | 1e6db4c30689636e31a8bca2817c2edd53991ff8 (patch) | |
tree | 958742ec17eaf372831eca48dd82d32350baa30b /src/codegen/helpers.rs | |
parent | 82462a37a149108db8c428f6caa5d8853ba25c40 (diff) |
Fix warnings
Diffstat (limited to 'src/codegen/helpers.rs')
-rw-r--r-- | src/codegen/helpers.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs index 205995bc..2ce6894f 100644 --- a/src/codegen/helpers.rs +++ b/src/codegen/helpers.rs @@ -230,14 +230,14 @@ pub mod ast_ty { } pub fn byte_array_expr(bytes: &[u8]) -> TokenStream { - let mut bytes: Vec<_> = bytes.iter().cloned().collect(); + let mut bytes: Vec<_> = bytes.to_vec(); bytes.push(0); quote! { [ #(#bytes),* ] } } pub fn cstr_expr(mut string: String) -> TokenStream { string.push('\0'); - let b = proc_macro2::Literal::byte_string(&string.as_bytes()); + let b = proc_macro2::Literal::byte_string(string.as_bytes()); quote! { #b } @@ -271,7 +271,7 @@ pub mod ast_ty { } warn!("Unknown non-finite float number: {:?}", f); - return Err(()); + Err(()) } pub fn arguments_from_signature( |