diff options
author | Jonas Schievink <jonasschievink@gmail.com> | 2017-07-26 17:28:47 +0200 |
---|---|---|
committer | Jonas Schievink <jonasschievink@gmail.com> | 2017-07-26 17:28:47 +0200 |
commit | 2b182860f7d91e55a10f4f0327eeb972e322d060 (patch) | |
tree | cd9da73e3928cc586ef9605502f129ede337db6a /src | |
parent | f657d301daa29fd24ef102d8616d23328d44e160 (diff) | |
download | mlua-2b182860f7d91e55a10f4f0327eeb972e322d060.zip |
Don't use hlist macros in userdata example
Diffstat (limited to 'src')
-rw-r--r-- | src/lua.rs | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1112,9 +1112,8 @@ impl<'lua, T: UserData> UserDataMethods<'lua, T> { /// [`UserDataMethods`] for more information): /// /// ``` -/// # #[macro_use] extern crate hlist_macro; /// # extern crate rlua; -/// # use rlua::{Lua, MetaMethod, UserData, UserDataMethods, Integer, Result}; +/// # use rlua::{Lua, MetaMethod, UserData, UserDataMethods, Result}; /// # fn try_main() -> Result<()> { /// struct MyUserData(i32); /// @@ -1126,15 +1125,15 @@ impl<'lua, T: UserData> UserDataMethods<'lua, T> { /// }); /// /// methods.add_method_mut("add", |lua, this, args| { -/// let hlist_pat![value]: HList![Integer] = lua.unpack(args)?; +/// let value: i32 = lua.unpack(args)?; /// -/// this.0 += value as i32; +/// this.0 += value; /// lua.pack(()) /// }); /// /// methods.add_meta_method(MetaMethod::Add, |lua, this, args| { -/// let hlist_pat![value]: HList![Integer] = lua.unpack(args)?; -/// lua.pack(this.0 + value as i32) +/// let value: i32 = lua.unpack(args)?; +/// lua.pack(this.0 + value) /// }); /// } /// } |