Implement Display for SharedValueSeries
The `Value::Object` variant in `ast/types.rs` has been updated to provide a more specific display format for `SharedValueSeries`. Previously, it would generically display the object's type name. This change allows it to directly show the length of the `SharedValueSeries` buffer, which is more informative.
This commit is contained in:
+1
-14
@@ -655,20 +655,7 @@ impl fmt::Display for Value {
|
||||
}
|
||||
Value::FieldAccessor(k) => write!(f, ".{}", k.name()),
|
||||
Value::Function(f_meta) => write!(f, "<native fn, {:?}>", f_meta.purity),
|
||||
Value::Object(o) => {
|
||||
if let Some(val_series) =
|
||||
o.as_any()
|
||||
.downcast_ref::<crate::ast::rtl::series::SharedValueSeries>()
|
||||
{
|
||||
write!(
|
||||
f,
|
||||
"SharedValueSeries[len: {}]",
|
||||
val_series.buffer.borrow().len()
|
||||
)
|
||||
} else {
|
||||
write!(f, "<{}>", o.type_name())
|
||||
}
|
||||
}
|
||||
Value::Object(o) => write!(f, "<{:?}>", o),
|
||||
Value::Cell(c) => write!(f, "{}", c.borrow()),
|
||||
Value::TailCallRequest(_) => write!(f, "<tail call request>"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user