Skip to content

Commit 5574017

Browse files
committed
style: format code.
1 parent de966b5 commit 5574017

File tree

3 files changed

+65
-77
lines changed

3 files changed

+65
-77
lines changed

src/rust/wcdb/src/base/param/enum_basic_expression.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ impl BasicExpression<'_> {
2424
let value = if value { 1 } else { 0 };
2525
(CPPType::Bool, value as c_longlong, 0 as c_double, None)
2626
}
27-
BasicExpression::Int(value) => {
28-
(CPPType::Int, value as c_longlong, 0 as c_double, None)
29-
}
27+
BasicExpression::Int(value) => (CPPType::Int, value as c_longlong, 0 as c_double, None),
3028
BasicExpression::Float(value) => {
3129
(CPPType::Double, 0 as c_longlong, value as c_double, None)
3230
}

src/rust/wcdb/src/base/param/enum_string_table_or_subquery.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ impl<'a> From<&str> for StringTableOrSubquery<'a> {
1818
}
1919
}
2020

21-
impl<'a, T: TableOrSubqueryConvertibleTrait + 'a> From<&'a T>
22-
for StringTableOrSubquery<'a>
23-
{
21+
impl<'a, T: TableOrSubqueryConvertibleTrait + 'a> From<&'a T> for StringTableOrSubquery<'a> {
2422
fn from(value: &'a T) -> Self {
2523
StringTableOrSubquery::TableOrSubquery(value)
2624
}

src/rust/wcdb/src/winq/statement_update.rs

Lines changed: 63 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -419,16 +419,14 @@ impl StatementUpdate {
419419
IntExpression::Int(to_value) => {
420420
self.config_limit_range_to_i64(from, to_value);
421421
}
422-
IntExpression::ExpressionConvertible(to_value_obj) => {
423-
match to_value_obj {
424-
None => {
425-
self.config_limit_count(from);
426-
}
427-
Some(to_value) => {
428-
self.config_limit_range(from, to_value);
429-
}
422+
IntExpression::ExpressionConvertible(to_value_obj) => match to_value_obj {
423+
None => {
424+
self.config_limit_count(from);
430425
}
431-
}
426+
Some(to_value) => {
427+
self.config_limit_range(from, to_value);
428+
}
429+
},
432430
}
433431
self
434432
}
@@ -446,24 +444,22 @@ impl StatementUpdate {
446444
from_value,
447445
);
448446
},
449-
IntExpression::ExpressionConvertible(from_value_opt) => {
450-
match from_value_opt {
451-
None => unsafe {
452-
WCDBRustStatementUpdate_configLimitCount(
453-
self.get_cpp_obj(),
454-
CPPType::Null as c_int,
455-
0,
456-
);
457-
},
458-
Some(from_value) => unsafe {
459-
WCDBRustStatementUpdate_configLimitCount(
460-
self.get_cpp_obj(),
461-
Identifier::get_cpp_type(from_value) as c_int,
462-
CppObject::get(from_value) as c_longlong,
463-
);
464-
},
465-
}
466-
}
447+
IntExpression::ExpressionConvertible(from_value_opt) => match from_value_opt {
448+
None => unsafe {
449+
WCDBRustStatementUpdate_configLimitCount(
450+
self.get_cpp_obj(),
451+
CPPType::Null as c_int,
452+
0,
453+
);
454+
},
455+
Some(from_value) => unsafe {
456+
WCDBRustStatementUpdate_configLimitCount(
457+
self.get_cpp_obj(),
458+
Identifier::get_cpp_type(from_value) as c_int,
459+
CppObject::get(from_value) as c_longlong,
460+
);
461+
},
462+
},
467463
}
468464
}
469465

@@ -482,28 +478,26 @@ impl StatementUpdate {
482478
CppObject::get(to) as c_longlong,
483479
)
484480
},
485-
IntExpression::ExpressionConvertible(from_value_opt) => {
486-
match from_value_opt {
487-
None => unsafe {
488-
WCDBRustStatementUpdate_configLimitRange(
489-
self.get_cpp_obj(),
490-
CPPType::Null as c_int,
491-
0 as c_longlong,
492-
Identifier::get_cpp_type(to) as c_int,
493-
CppObject::get(to) as c_longlong,
494-
)
495-
},
496-
Some(from_value) => unsafe {
497-
WCDBRustStatementUpdate_configLimitRange(
498-
self.get_cpp_obj(),
499-
Identifier::get_cpp_type(from_value) as c_int,
500-
CppObject::get(from_value) as c_longlong,
501-
Identifier::get_cpp_type(to) as c_int,
502-
CppObject::get(to) as c_longlong,
503-
)
504-
},
505-
}
506-
}
481+
IntExpression::ExpressionConvertible(from_value_opt) => match from_value_opt {
482+
None => unsafe {
483+
WCDBRustStatementUpdate_configLimitRange(
484+
self.get_cpp_obj(),
485+
CPPType::Null as c_int,
486+
0 as c_longlong,
487+
Identifier::get_cpp_type(to) as c_int,
488+
CppObject::get(to) as c_longlong,
489+
)
490+
},
491+
Some(from_value) => unsafe {
492+
WCDBRustStatementUpdate_configLimitRange(
493+
self.get_cpp_obj(),
494+
Identifier::get_cpp_type(from_value) as c_int,
495+
CppObject::get(from_value) as c_longlong,
496+
Identifier::get_cpp_type(to) as c_int,
497+
CppObject::get(to) as c_longlong,
498+
)
499+
},
500+
},
507501
}
508502
}
509503

@@ -522,28 +516,26 @@ impl StatementUpdate {
522516
to as c_longlong,
523517
)
524518
},
525-
IntExpression::ExpressionConvertible(from_value_opt) => {
526-
match from_value_opt {
527-
None => unsafe {
528-
WCDBRustStatementUpdate_configLimitRange(
529-
self.get_cpp_obj(),
530-
CPPType::Null as c_int,
531-
0 as c_longlong,
532-
CPPType::Int as c_int,
533-
to as c_longlong,
534-
)
535-
},
536-
Some(from_value) => unsafe {
537-
WCDBRustStatementUpdate_configLimitRange(
538-
self.get_cpp_obj(),
539-
Identifier::get_cpp_type(from_value) as c_int,
540-
CppObject::get(from_value) as c_longlong,
541-
CPPType::Int as c_int,
542-
to as c_longlong,
543-
)
544-
},
545-
}
546-
}
519+
IntExpression::ExpressionConvertible(from_value_opt) => match from_value_opt {
520+
None => unsafe {
521+
WCDBRustStatementUpdate_configLimitRange(
522+
self.get_cpp_obj(),
523+
CPPType::Null as c_int,
524+
0 as c_longlong,
525+
CPPType::Int as c_int,
526+
to as c_longlong,
527+
)
528+
},
529+
Some(from_value) => unsafe {
530+
WCDBRustStatementUpdate_configLimitRange(
531+
self.get_cpp_obj(),
532+
Identifier::get_cpp_type(from_value) as c_int,
533+
CppObject::get(from_value) as c_longlong,
534+
CPPType::Int as c_int,
535+
to as c_longlong,
536+
)
537+
},
538+
},
547539
}
548540
}
549541

0 commit comments

Comments
 (0)