summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
author+merlan #flirora <uruwi@protonmail.com>2024-10-07 15:28:30 -0400
committerGitHub <noreply@github.com>2024-10-07 19:28:30 +0000
commit037c0c82160088f5f8026e2b6808db20c874e8ad (patch)
tree82d196f2e1b265cbc366c6273554e2c77d729e76 /crates
parent1d2a222818991bcc3ade54fdd30480ce1fb8826f (diff)
Fix hint for destructuring to an array with at least 1 element (#5154)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/eval/binding.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/typst/src/eval/binding.rs b/crates/typst/src/eval/binding.rs
index 89e536c0..18468b9e 100644
--- a/crates/typst/src/eval/binding.rs
+++ b/crates/typst/src/eval/binding.rs
@@ -195,6 +195,7 @@ fn wrong_number_of_elements(
let quantifier = if len > count { "too many" } else { "not enough" };
let expected = match (spread, count) {
+ (true, 1) => "at least 1 element".into(),
(true, c) => eco_format!("at least {c} elements"),
(false, 0) => "an empty array".into(),
(false, 1) => "a single element".into(),