Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
amigin committed Nov 23, 2022
1 parent f98a65e commit 09cc45a
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions src/fn_impl_where_data/fn_get_field_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,37 +58,33 @@ fn fill_option_of(result: &mut String, struct_propery: &StructProperty, sub_type
types_reader::PropertyType::Str => fill_option_of_sql_value(result, struct_propery),
types_reader::PropertyType::DateTime => fill_option_of_sql_value(result, struct_propery),
types_reader::PropertyType::VecOf(sub_type) => {
get_field_value_of_option_of_vec(result, struct_propery, sub_type)
fill_option_of_vec(result, struct_propery, sub_type)
}
_ => panic!("{} is not supported", struct_propery.ty.as_str()),
}
}

fn get_field_value_of_option_of_vec(
fn fill_option_of_vec(
result: &mut String,
struct_propery: &StructProperty,
sub_type: &PropertyType,
) {
match sub_type {
types_reader::PropertyType::U8 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::I8 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::U16 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::I16 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::U32 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::I32 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::U64 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::I64 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::F32 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::F64 => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::String => {
fill_option_of_vec_of_sql_value(result, struct_propery)
}
types_reader::PropertyType::Str => fill_option_of_vec_of_sql_value(result, struct_propery),
types_reader::PropertyType::DateTime => {
fill_option_of_vec_of_sql_value(result, struct_propery)
}
types_reader::PropertyType::U8 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::I8 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::U16 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::I16 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::U32 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::I32 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::U64 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::I64 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::F32 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::F64 => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::String => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::Str => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::DateTime => fill_option_of_vec_of_value(result, struct_propery),
types_reader::PropertyType::Struct(_) => {
fill_option_of_vec_of_sql_value(result, struct_propery)
fill_option_of_vec_of_value(result, struct_propery)
}
_ => panic!("Vec<{}> is not supported", sub_type.as_str()),
}
Expand Down Expand Up @@ -138,7 +134,7 @@ fn fill_option_of_sql_value(result: &mut String, struct_propery: &StructProperty
result.push_str("}");
}

fn fill_option_of_vec_of_sql_value(result: &mut String, struct_propery: &StructProperty) {
fn fill_option_of_vec_of_value(result: &mut String, struct_propery: &StructProperty) {
result.push_str("my_postgres::SqlWhereValue::to_in_operator(\"");
result.push_str(struct_propery.get_db_field_name());
result.push_str("\", &self.");
Expand Down

0 comments on commit 09cc45a

Please sign in to comment.