aboutsummaryrefslogtreecommitdiffstats
path: root/askama_parser/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <rene.kijewski@fu-berlin.de>2023-08-01 02:42:20 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-08-01 10:51:57 +0200
commitcbf766fa1fb89dd3fc7bec7010b723945e44dea2 (patch)
treebf3f03df8d01d1f941db50e6bee097454af2033d /askama_parser/src/lib.rs
parentcfed9274e2637a6abb8d75545297859705a0ac37 (diff)
downloadaskama-cbf766fa1fb89dd3fc7bec7010b723945e44dea2.tar.gz
askama-cbf766fa1fb89dd3fc7bec7010b723945e44dea2.tar.bz2
askama-cbf766fa1fb89dd3fc7bec7010b723945e44dea2.zip
parser: impement `PartialEq` for `Ast`
Diffstat (limited to 'askama_parser/src/lib.rs')
-rw-r--r--askama_parser/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/askama_parser/src/lib.rs b/askama_parser/src/lib.rs
index a19181d..6ff9360 100644
--- a/askama_parser/src/lib.rs
+++ b/askama_parser/src/lib.rs
@@ -23,6 +23,7 @@ mod node;
mod tests;
mod _parsed {
+ use std::cmp::PartialEq;
use std::{fmt, mem};
use super::{Ast, Node, ParseError, Syntax};
@@ -57,6 +58,12 @@ mod _parsed {
.finish_non_exhaustive()
}
}
+
+ impl PartialEq for Parsed {
+ fn eq(&self, other: &Self) -> bool {
+ self.ast.nodes == other.ast.nodes
+ }
+ }
}
pub use _parsed::Parsed;