From cbf766fa1fb89dd3fc7bec7010b723945e44dea2 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Tue, 1 Aug 2023 02:42:20 +0200 Subject: parser: impement `PartialEq` for `Ast` --- askama_parser/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'askama_parser/src/lib.rs') 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; -- cgit