Fix clippy lints
This commit is contained in:
parent
66ca6699ca
commit
22b4e02c86
|
@ -52,7 +52,7 @@ pub mod de;
|
||||||
use rlua::{Context, Value, Error};
|
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 };
|
let serializer = ser::Serializer { lua };
|
||||||
Ok(t.serialize(serializer)?)
|
Ok(t.serialize(serializer)?)
|
||||||
}
|
}
|
||||||
|
|
14
src/ser.rs
14
src/ser.rs
|
@ -29,17 +29,17 @@ impl<'lua> serde::Serializer for Serializer<'lua> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize_i8(self, value: i8) -> Result<Value<'lua>> {
|
fn serialize_i8(self, value: i8) -> Result<Value<'lua>> {
|
||||||
self.serialize_i64(value as i64)
|
self.serialize_i64(i64::from(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize_i16(self, value: i16) -> Result<Value<'lua>> {
|
fn serialize_i16(self, value: i16) -> Result<Value<'lua>> {
|
||||||
self.serialize_i64(value as i64)
|
self.serialize_i64(i64::from(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize_i32(self, value: i32) -> Result<Value<'lua>> {
|
fn serialize_i32(self, value: i32) -> Result<Value<'lua>> {
|
||||||
self.serialize_i64(value as i64)
|
self.serialize_i64(i64::from(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -49,17 +49,17 @@ impl<'lua> serde::Serializer for Serializer<'lua> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize_u8(self, value: u8) -> Result<Value<'lua>> {
|
fn serialize_u8(self, value: u8) -> Result<Value<'lua>> {
|
||||||
self.serialize_i64(value as i64)
|
self.serialize_i64(i64::from(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize_u16(self, value: u16) -> Result<Value<'lua>> {
|
fn serialize_u16(self, value: u16) -> Result<Value<'lua>> {
|
||||||
self.serialize_i64(value as i64)
|
self.serialize_i64(i64::from(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize_u32(self, value: u32) -> Result<Value<'lua>> {
|
fn serialize_u32(self, value: u32) -> Result<Value<'lua>> {
|
||||||
self.serialize_i64(value as i64)
|
self.serialize_i64(i64::from(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -69,7 +69,7 @@ impl<'lua> serde::Serializer for Serializer<'lua> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize_f32(self, value: f32) -> Result<Value<'lua>> {
|
fn serialize_f32(self, value: f32) -> Result<Value<'lua>> {
|
||||||
self.serialize_f64(value as f64)
|
self.serialize_f64(f64::from(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in New Issue