From 5904e76b175f53c049d22e56d2e20a972cbe50e4 Mon Sep 17 00:00:00 2001 From: Dayvson Spacca Date: Wed, 21 Aug 2024 16:25:08 -0300 Subject: [PATCH] chore: update fn returns --- src/sqlite.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/sqlite.rs b/src/sqlite.rs index 27069e4..8b6692d 100644 --- a/src/sqlite.rs +++ b/src/sqlite.rs @@ -482,8 +482,8 @@ impl Insert { /// ("manager_id", "1"), /// ]); /// ``` - pub fn new(table: &str) -> Insert { - Insert { + pub fn new(table: &str) -> Self { + Self { table: table.to_string(), values: Vec::new(), } @@ -611,12 +611,9 @@ impl Where { } /// Adds a less than or equal condition (`field <= value`) to the WHERE clause. - pub fn less_than_equal( - &mut self, - field: &str, - value: &str, - ) -> Result<&mut Self, SqlBuilderError> { - self.add_predicate(field, "<=", value) + pub fn less_than_equal(&mut self, field: &str, value: &str) -> &mut Self { + self.add_predicate(field, "<=", value).unwrap(); + self } /// Adds a `IS NULL` condition (`field IS NULL`) to the WHERE clause.