diff options
| author | Alex Saveau <saveau.alexandre@gmail.com> | 2023-06-09 01:25:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-09 10:25:12 +0200 |
| commit | 61effc350a1d5c6a710ff708ce8184180bd6f7c6 (patch) | |
| tree | 526abb61496045ce7eb044b9369746d01f31ef32 /library/src/math | |
| parent | f62f7624a6f56793d06afeecd16c27ed07621ed8 (diff) | |
Don't type check matrices (#1442)
Diffstat (limited to 'library/src/math')
| -rw-r--r-- | library/src/math/matrix.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/src/math/matrix.rs b/library/src/math/matrix.rs index 84dcfd9b..aaccc332 100644 --- a/library/src/math/matrix.rs +++ b/library/src/math/matrix.rs @@ -93,15 +93,15 @@ pub struct MatElem { let mut width = 0; let values = args.all::<Spanned<Value>>()?; - if values.iter().all(|spanned| matches!(spanned.v, Value::Content(_))) { - rows = vec![values.into_iter().map(|spanned| spanned.v.display()).collect()]; - } else { + if values.iter().any(|spanned| matches!(spanned.v, Value::Array(_))) { for Spanned { v, span } in values { let array = v.cast::<Array>().at(span)?; let row: Vec<_> = array.into_iter().map(Value::display).collect(); width = width.max(row.len()); rows.push(row); } + } else { + rows = vec![values.into_iter().map(|spanned| spanned.v.display()).collect()]; } for row in &mut rows { |
