From cfed9274e2637a6abb8d75545297859705a0ac37 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Tue, 1 Aug 2023 02:39:27 +0200 Subject: parser: implement `Debug` for `Parsed` --- askama_parser/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'askama_parser/src') diff --git a/askama_parser/src/lib.rs b/askama_parser/src/lib.rs index 37c1977..a19181d 100644 --- a/askama_parser/src/lib.rs +++ b/askama_parser/src/lib.rs @@ -23,7 +23,7 @@ mod node; mod tests; mod _parsed { - use std::mem; + use std::{fmt, mem}; use super::{Ast, Node, ParseError, Syntax}; @@ -49,6 +49,14 @@ mod _parsed { &self.ast.nodes } } + + impl fmt::Debug for Parsed { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Parsed") + .field("nodes", &self.ast.nodes) + .finish_non_exhaustive() + } + } } pub use _parsed::Parsed; -- cgit