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:39:27 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-08-01 10:51:57 +0200
commitcfed9274e2637a6abb8d75545297859705a0ac37 (patch)
tree7f6016f14a2daed8baf1129593b5161a60d4bf66 /askama_parser/src/lib.rs
parent382c3239f25488f837304bfffb4bab26e8e72f4a (diff)
downloadaskama-cfed9274e2637a6abb8d75545297859705a0ac37.tar.gz
askama-cfed9274e2637a6abb8d75545297859705a0ac37.tar.bz2
askama-cfed9274e2637a6abb8d75545297859705a0ac37.zip
parser: implement `Debug` for `Parsed`
Diffstat (limited to '')
-rw-r--r--askama_parser/src/lib.rs10
1 files changed, 9 insertions, 1 deletions
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;