mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 07:32:26 +03:00
merge and print strings like strings, rather than arrays
This commit is contained in:
parent
947f13b77b
commit
c4a1bd6955
@ -99,6 +99,13 @@ impl<'a, F: PrimeField, G: GroupType<F>> fmt::Display for ConstrainedValue<'a, F
|
||||
|
||||
// Data type wrappers
|
||||
ConstrainedValue::Array(ref array) => {
|
||||
if matches!(array[0], ConstrainedValue::Char(_)) {
|
||||
for character in array {
|
||||
write!(f, "{}", character)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
} else {
|
||||
write!(f, "[")?;
|
||||
for (i, e) in array.iter().enumerate() {
|
||||
write!(f, "{}", e)?;
|
||||
@ -108,6 +115,7 @@ impl<'a, F: PrimeField, G: GroupType<F>> fmt::Display for ConstrainedValue<'a, F
|
||||
}
|
||||
write!(f, "]")
|
||||
}
|
||||
}
|
||||
ConstrainedValue::Tuple(ref tuple) => {
|
||||
let values = tuple.iter().map(|x| x.to_string()).collect::<Vec<_>>().join(", ");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user