clippy for Into -> From
This commit is contained in:
parent
827a401fbc
commit
07b7dd0337
1 changed files with 37 additions and 39 deletions
76
src/value.rs
76
src/value.rs
|
|
@ -94,69 +94,67 @@ impl Value {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for i32 {
|
impl From<i32> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: i32) -> Value {
|
||||||
Value::I32(self)
|
Value::I32(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for i64 {
|
impl From<i64> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: i64) -> Value {
|
||||||
Value::I64(self)
|
Value::I64(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for u32 {
|
impl From<u32> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: u32) -> Value {
|
||||||
Value::U32(self)
|
Value::U32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl From<u64> for Value {
|
||||||
|
fn from(v: u64) -> Value {
|
||||||
|
Value::U64(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl From<f32> for Value {
|
||||||
|
fn from(v: f32) -> Value {
|
||||||
|
Value::F32(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for u64 {
|
impl From<f64> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: f64) -> Value {
|
||||||
Value::U64(self)
|
Value::F64(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for f32 {
|
impl From<&str> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: &str) -> Value {
|
||||||
Value::F32(self)
|
Value::String(v.to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for f64 {
|
impl From<String> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: String) -> Value {
|
||||||
Value::F64(self)
|
Value::String(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for &str {
|
impl From<char> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: char) -> Value {
|
||||||
Value::String(self.to_string())
|
Value::Char(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for String {
|
impl From<bool> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: bool) -> Value {
|
||||||
Value::String(self)
|
Value::Bool(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Value> for char {
|
impl From<DateTime<Utc>> for Value {
|
||||||
fn into(self) -> Value {
|
fn from(v: DateTime<Utc>) -> Value {
|
||||||
Value::Char(self)
|
Value::DateTime(Box::new(v))
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Into<Value> for bool {
|
|
||||||
fn into(self) -> Value {
|
|
||||||
Value::Bool(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Into<Value> for DateTime<Utc> {
|
|
||||||
fn into(self) -> Value {
|
|
||||||
Value::DateTime(Box::new(self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue