Updated lib to latest version and fmt

This commit is contained in:
Martin Berg Alstad
2024-07-17 13:04:05 +02:00
parent 4447d800df
commit d948471ed5
5 changed files with 196 additions and 103 deletions

View File

@ -1,5 +1,5 @@
use axum::response::{IntoResponse, Response};
use lib::derive::IntoResponse;
use lib::into_response_derive::IntoResponse;
use serde::Serialize;
use crate::expressions::expression::Expression;
@ -16,7 +16,11 @@ pub struct Operation {
impl Operation {
pub fn new(before: &Expression, after: &Expression, law: Law) -> Option<Self> {
if before != after {
Some(Self { before: before.to_string(), after: after.to_string(), law })
Some(Self {
before: before.to_string(),
after: after.to_string(),
law,
})
} else {
None
}
@ -50,4 +54,4 @@ impl IsValidResponse {
#[serde(rename_all = "camelCase")]
pub struct TruthTableResponse {
pub truth_table: TruthTable,
}
}