From 123e8b1b486ac8c6c57af41af46ac96c7b70e372 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 5 Jan 2022 13:48:25 +0800 Subject: [PATCH] Improve FnPtr debug display. --- src/types/fn_ptr.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/types/fn_ptr.rs b/src/types/fn_ptr.rs index 9b707e39..249e50a0 100644 --- a/src/types/fn_ptr.rs +++ b/src/types/fn_ptr.rs @@ -24,7 +24,12 @@ impl fmt::Debug for FnPtr { if !self.is_curried() { write!(f, "Fn({})", self.fn_name()) } else { - f.debug_tuple("Fn").field(&self.0).field(&self.1).finish() + self.1 + .iter() + .fold(f.debug_tuple("Fn").field(&self.0), |f, curry| { + f.field(curry) + }) + .finish() } } }