Skip to content

Commit 131fb26

Browse files
committed
Remove explicit error catch
1 parent d1465cf commit 131fb26

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lib/dsc-lib/locales/en-us.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ invoked = "null function"
450450

451451
[functions.objectKeys]
452452
description = "Returns the keys from an object, where an object is a collection of key-value pairs"
453-
notObject = "Argument must be an object"
454453

455454
[functions.or]
456455
description = "Evaluates if any arguments are true"

lib/dsc-lib/src/functions/object_keys.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ impl Function for ObjectKeys {
2727
}
2828

2929
fn invoke(&self, args: &[Value], _context: &Context) -> Result<Value, DscError> {
30-
let Some(obj) = args[0].as_object() else {
31-
return Err(DscError::Parser(t!("functions.objectKeys.notObject").to_string()));
32-
};
30+
let obj = args[0].as_object().unwrap();
3331

3432
let keys: Vec<Value> = obj
3533
.keys()

0 commit comments

Comments
 (0)