Ignore Case function
This commit is contained in:
@ -2,15 +2,17 @@ use serde::Deserialize;
|
||||
use crate::expressions::truth_table::{Hide, Sort};
|
||||
use crate::utils::serialize::{ret_true, deserialize_bool};
|
||||
|
||||
// TODO deserialize_bool should not be necessary
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SimplifyOptions {
|
||||
#[serde(
|
||||
default = "ret_true",
|
||||
deserialize_with = "deserialize_bool"
|
||||
)]
|
||||
pub simplify: bool,
|
||||
#[serde(default = "ret_true")]
|
||||
pub case_sensitive: bool, // TODO: Implement case sensitivity
|
||||
#[serde(default, deserialize_with = "deserialize_bool")]
|
||||
pub ignore_case: bool,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
|
@ -20,7 +20,7 @@ async fn simplify(Path(path): Path<String>, Query(query): Query<SimplifyOptions>
|
||||
let before = expression.to_string();
|
||||
let mut operations = vec![];
|
||||
if query.simplify {
|
||||
(expression, operations) = expression.simplify();
|
||||
(expression, operations) = expression.simplify(query.into());
|
||||
}
|
||||
SimplifyResponse {
|
||||
before,
|
||||
@ -42,7 +42,7 @@ async fn simplify_and_table(Path(path): Path<String>, Query(query): Query<Simpli
|
||||
let before = expression.to_string();
|
||||
let mut operations = vec![];
|
||||
if query.simplify_options.simplify {
|
||||
(expression, operations) = expression.simplify();
|
||||
(expression, operations) = expression.simplify(query.simplify_options.into());
|
||||
}
|
||||
let truth_table = TruthTable::new(&expression, query.table_options);
|
||||
SimplifyResponse {
|
||||
|
Reference in New Issue
Block a user