Start of implementation for serde_json but I'm going to change my approach.
The permutations are pretty intense, so I think I'm going to do the same design I did for comparison where I have a JsonNumber (but I'll call this one MathNumber and rename JsonNumber to ComparisonNumber), convert the types to that, and then do the math.
This commit is contained in:
@@ -21,6 +21,7 @@ pub use context_element::Walkable;
|
||||
pub use errors::CompileError;
|
||||
pub use errors::RenderError;
|
||||
pub use errors::WalkError;
|
||||
pub use parameters_context::math_ints;
|
||||
pub use renderer::compile_template;
|
||||
pub use renderer::DustRenderer;
|
||||
pub use select_context::SelectContext;
|
||||
|
||||
@@ -388,7 +388,7 @@ impl CompareContextElement for OwnedLiteral {
|
||||
|
||||
/// For math operations that take in integers and return integers
|
||||
/// (add, subtract, multiply)
|
||||
fn math_ints<L, R, F>(left: L, right: R, operation: F) -> Option<OwnedLiteral>
|
||||
pub fn math_ints<L, R, F>(left: L, right: R, operation: F) -> Option<OwnedLiteral>
|
||||
where
|
||||
L: Into<i128>,
|
||||
R: Into<i128>,
|
||||
|
||||
Reference in New Issue
Block a user