summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2017-07-26 17:28:47 +0200
committerJonas Schievink <jonasschievink@gmail.com>2017-07-26 17:28:47 +0200
commit2b182860f7d91e55a10f4f0327eeb972e322d060 (patch)
treecd9da73e3928cc586ef9605502f129ede337db6a /src
parentf657d301daa29fd24ef102d8616d23328d44e160 (diff)
downloadmlua-2b182860f7d91e55a10f4f0327eeb972e322d060.zip
Don't use hlist macros in userdata example
Diffstat (limited to 'src')
-rw-r--r--src/lua.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lua.rs b/src/lua.rs
index f6380d2..1231ac4 100644
--- a/src/lua.rs
+++ b/src/lua.rs
@@ -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)
/// });
/// }
/// }