chore: lint code with cargo format
This commit is contained in:
@@ -30,12 +30,8 @@ fn from_condition(
|
|||||||
(_, Condition::Bool(_)) => return Err(FailedTo::ComposeFilter),
|
(_, Condition::Bool(_)) => return Err(FailedTo::ComposeFilter),
|
||||||
// SIGNED INT
|
// SIGNED INT
|
||||||
(Comparison::Equal, Condition::SignedInt(_)) => compose_fragment("value_int", "=", i),
|
(Comparison::Equal, Condition::SignedInt(_)) => compose_fragment("value_int", "=", i),
|
||||||
(Comparison::Greater, Condition::SignedInt(_)) => {
|
(Comparison::Greater, Condition::SignedInt(_)) => compose_fragment("value_int", ">", i),
|
||||||
compose_fragment("value_int", ">", i)
|
(Comparison::Lesser, Condition::SignedInt(_)) => compose_fragment("value_int", "<", i),
|
||||||
}
|
|
||||||
(Comparison::Lesser, Condition::SignedInt(_)) => {
|
|
||||||
compose_fragment("value_int", "<", i)
|
|
||||||
}
|
|
||||||
(Comparison::GreaterOrEqual, Condition::SignedInt(_)) => {
|
(Comparison::GreaterOrEqual, Condition::SignedInt(_)) => {
|
||||||
compose_fragment("value_int", ">=", i)
|
compose_fragment("value_int", ">=", i)
|
||||||
}
|
}
|
||||||
@@ -44,15 +40,9 @@ fn from_condition(
|
|||||||
}
|
}
|
||||||
(_, Condition::SignedInt(_)) => return Err(FailedTo::ComposeFilter),
|
(_, Condition::SignedInt(_)) => return Err(FailedTo::ComposeFilter),
|
||||||
// UNSIGNED INT
|
// UNSIGNED INT
|
||||||
(Comparison::Equal, Condition::UnsignedInt(_)) => {
|
(Comparison::Equal, Condition::UnsignedInt(_)) => compose_fragment("value_uint", "=", i),
|
||||||
compose_fragment("value_uint", "=", i)
|
(Comparison::Greater, Condition::UnsignedInt(_)) => compose_fragment("value_uint", ">", i),
|
||||||
}
|
(Comparison::Lesser, Condition::UnsignedInt(_)) => compose_fragment("value_uint", "<", i),
|
||||||
(Comparison::Greater, Condition::UnsignedInt(_)) => {
|
|
||||||
compose_fragment("value_uint", ">", i)
|
|
||||||
}
|
|
||||||
(Comparison::Lesser, Condition::UnsignedInt(_)) => {
|
|
||||||
compose_fragment("value_uint", "<", i)
|
|
||||||
}
|
|
||||||
(Comparison::GreaterOrEqual, Condition::UnsignedInt(_)) => {
|
(Comparison::GreaterOrEqual, Condition::UnsignedInt(_)) => {
|
||||||
compose_fragment("value_uint", ">=", i)
|
compose_fragment("value_uint", ">=", i)
|
||||||
}
|
}
|
||||||
@@ -64,12 +54,8 @@ fn from_condition(
|
|||||||
(Comparison::Equal, Condition::Real(_)) => compose_fragment("value_real", "=", i),
|
(Comparison::Equal, Condition::Real(_)) => compose_fragment("value_real", "=", i),
|
||||||
(Comparison::Greater, Condition::Real(_)) => compose_fragment("value_real", ">", i),
|
(Comparison::Greater, Condition::Real(_)) => compose_fragment("value_real", ">", i),
|
||||||
(Comparison::Lesser, Condition::Real(_)) => compose_fragment("value_real", "<", i),
|
(Comparison::Lesser, Condition::Real(_)) => compose_fragment("value_real", "<", i),
|
||||||
(Comparison::GreaterOrEqual, Condition::Real(_)) => {
|
(Comparison::GreaterOrEqual, Condition::Real(_)) => compose_fragment("value_real", ">=", i),
|
||||||
compose_fragment("value_real", ">=", i)
|
(Comparison::LesserOrEqual, Condition::Real(_)) => compose_fragment("value_real", "<=", i),
|
||||||
}
|
|
||||||
(Comparison::LesserOrEqual, Condition::Real(_)) => {
|
|
||||||
compose_fragment("value_real", "<=", i)
|
|
||||||
}
|
|
||||||
(_, Condition::Real(_)) => return Err(FailedTo::ComposeFilter),
|
(_, Condition::Real(_)) => return Err(FailedTo::ComposeFilter),
|
||||||
// TEXT
|
// TEXT
|
||||||
(Comparison::IsExactly, Condition::Text(_)) => compose_fragment("value_text", "=", i),
|
(Comparison::IsExactly, Condition::Text(_)) => compose_fragment("value_text", "=", i),
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ pub enum FailedTo {
|
|||||||
PrepareStatement(rusqlite::Error),
|
PrepareStatement(rusqlite::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::error::Error for FailedTo{}
|
impl std::error::Error for FailedTo {}
|
||||||
|
|
||||||
impl std::fmt::Display for FailedTo {
|
impl std::fmt::Display for FailedTo {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::result::Result<(), std::fmt::Error> {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::result::Result<(), std::fmt::Error> {
|
||||||
|
|||||||
Reference in New Issue
Block a user