diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-10 20:47:23 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-10 21:19:50 +0100 |
| commit | a9fdff244aef859449a76e5f762ee7c343a8ddcc (patch) | |
| tree | 172b543183296b4bc30b3008650f594688467914 /src/eval/args.rs | |
| parent | 62f35602a87574dcc607f1637aeae1be574981ff (diff) | |
Expose content representation more
Diffstat (limited to 'src/eval/args.rs')
| -rw-r--r-- | src/eval/args.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/eval/args.rs b/src/eval/args.rs index 159e9a77..17bd9cb4 100644 --- a/src/eval/args.rs +++ b/src/eval/args.rs @@ -1,10 +1,11 @@ -use std::fmt::{self, Debug, Formatter, Write}; +use std::fmt::{self, Debug, Formatter}; -use ecow::EcoVec; +use ecow::{eco_format, EcoVec}; use super::{Array, Cast, Dict, Str, Value}; use crate::diag::{bail, At, SourceResult}; use crate::syntax::{Span, Spanned}; +use crate::util::pretty_array; /// Evaluated arguments to a function. #[derive(Clone, PartialEq, Hash)] @@ -171,14 +172,9 @@ impl Args { impl Debug for Args { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - f.write_char('(')?; - for (i, arg) in self.items.iter().enumerate() { - arg.fmt(f)?; - if i + 1 < self.items.len() { - f.write_str(", ")?; - } - } - f.write_char(')') + let pieces: Vec<_> = + self.items.iter().map(|arg| eco_format!("{arg:?}")).collect(); + f.write_str(&pretty_array(&pieces, false)) } } |
