Fix plurals in abbrevations (#409)

This commit is contained in:
JT 2021-12-03 10:36:54 +13:00 committed by GitHub
parent 19766556f3
commit d9bedaae2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,8 +345,16 @@ impl Value {
) )
} }
Value::String { val, .. } => val, Value::String { val, .. } => val,
Value::List { vals: val, .. } => format!("[list {} items]", val.len()), Value::List { vals: val, .. } => format!(
Value::Record { cols, .. } => format!("{{record {} fields}}", cols.len()), "[list {} item{}]",
val.len(),
if val.len() == 1 { "" } else { "s" }
),
Value::Record { cols, .. } => format!(
"{{record {} field{}}}",
cols.len(),
if cols.len() == 1 { "" } else { "s" }
),
Value::Block { val, .. } => format!("<Block {}>", val), Value::Block { val, .. } => format!("<Block {}>", val),
Value::Nothing { .. } => String::new(), Value::Nothing { .. } => String::new(),
Value::Error { error } => format!("{:?}", error), Value::Error { error } => format!("{:?}", error),