Fix clippy lints

This commit is contained in:
zrkn 2019-02-08 14:43:24 +03:00
parent 66ca6699ca
commit 22b4e02c86
2 changed files with 8 additions and 8 deletions

View File

@ -52,7 +52,7 @@ pub mod de;
use rlua::{Context, Value, Error};
pub fn to_value<'lua, T: serde::Serialize>(lua: Context<'lua>, t: T) -> Result<Value<'lua>, Error> {
pub fn to_value<T: serde::Serialize>(lua: Context, t: T) -> Result<Value, Error> {
let serializer = ser::Serializer { lua };
Ok(t.serialize(serializer)?)
}

View File

@ -29,17 +29,17 @@ impl<'lua> serde::Serializer for Serializer<'lua> {
#[inline]
fn serialize_i8(self, value: i8) -> Result<Value<'lua>> {
self.serialize_i64(value as i64)
self.serialize_i64(i64::from(value))
}
#[inline]
fn serialize_i16(self, value: i16) -> Result<Value<'lua>> {
self.serialize_i64(value as i64)
self.serialize_i64(i64::from(value))
}
#[inline]
fn serialize_i32(self, value: i32) -> Result<Value<'lua>> {
self.serialize_i64(value as i64)
self.serialize_i64(i64::from(value))
}
#[inline]
@ -49,17 +49,17 @@ impl<'lua> serde::Serializer for Serializer<'lua> {
#[inline]
fn serialize_u8(self, value: u8) -> Result<Value<'lua>> {
self.serialize_i64(value as i64)
self.serialize_i64(i64::from(value))
}
#[inline]
fn serialize_u16(self, value: u16) -> Result<Value<'lua>> {
self.serialize_i64(value as i64)
self.serialize_i64(i64::from(value))
}
#[inline]
fn serialize_u32(self, value: u32) -> Result<Value<'lua>> {
self.serialize_i64(value as i64)
self.serialize_i64(i64::from(value))
}
#[inline]
@ -69,7 +69,7 @@ impl<'lua> serde::Serializer for Serializer<'lua> {
#[inline]
fn serialize_f32(self, value: f32) -> Result<Value<'lua>> {
self.serialize_f64(value as f64)
self.serialize_f64(f64::from(value))
}
#[inline]