Skip to content

Commit e1f6e5d

Browse files
committed
Round trip a string from Neovim -> Rust -> Neovim
1 parent dbd3032 commit e1f6e5d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
extern crate mlua_derive;
33

44
use mlua::prelude::*;
5-
use pulldown_cmark::{Options, Parser};
65

7-
fn hello(_: &Lua, name: String) -> LuaResult<()> {
8-
println!("hello, {}!", name);
9-
Ok(())
6+
fn hello(_: &Lua, name: String) -> LuaResult<String> {
7+
let a: String = String::from(format!("not you {} he he", name));
8+
Ok(a)
109
}
1110

1211
#[lua_module]
13-
fn my_module(lua: &Lua) -> LuaResult<LuaTable> {
12+
fn libvim_pandoc_syntax(lua: &Lua) -> LuaResult<LuaTable> {
1413
let exports = lua.create_table()?;
1514
exports.set("hello", lua.create_function(hello)?)?;
1615
Ok(exports)

0 commit comments

Comments
 (0)