From 575d64a445b47e22af708044e348295f1981bcf2 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Sat, 25 Feb 2023 00:30:03 -0800 Subject: [PATCH] Fix module macro --- Cargo.toml | 2 +- README.md | 2 +- macros/src/lib.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 51b56c5..eb87657 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nvim-utils" -version = "0.1.7" +version = "0.1.8" edition = "2021" description = "Utilities for writing neovim plugins in rust" authors = ["Will Hopkins "] diff --git a/README.md b/README.md index 255226a..42ddebb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Using `nvim-utils` is as simple as adding it to your `Cargo.toml`: ```toml [dependencies] -nvim-utils = "0.1.7" +nvim-utils = "0.1.8" ``` or diff --git a/macros/src/lib.rs b/macros/src/lib.rs index ead1067..22577a2 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -3,7 +3,7 @@ use mlua::lua_State; use proc_macro::TokenStream; use proc_macro2::Span; use quote::quote; -use syn::{AttributeArgs, Error, Path, Result}; +use syn::{AttributeArgs, Error, Ident, Path, Result}; struct Plugin { path: Path, @@ -47,7 +47,7 @@ pub fn module(attr: TokenStream, item: TokenStream) -> TokenStream { .join("_"); let func = syn::parse_macro_input!(item as syn::ItemFn); - let name = func.sig.ident.to_string(); + let name = func.sig.ident.clone(); let entry = Ident::new(&format!("luaopen_{path}"), Span::call_site()); let wrapped = quote! {