Skip to content

Commit 580d625

Browse files
committed
add missing localized text and remove unwrap
1 parent b53f6f1 commit 580d625

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dsc_lib/locales/en-us.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ invoked = "contains function"
266266
invalidItemToFind = "Invalid item to find, must be a string or number"
267267
invalidArgType = "Invalid argument type, first argument must be an array, object, or string"
268268

269+
[functions.context]
270+
description = "Retrieves context information about the current execution environment"
271+
invoked = "context function"
272+
269273
[functions.copyIndex]
270274
description = "Returns the current copy index"
271275
invoked = "copyIndex function"

dsc_lib/src/functions/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ impl Function for Context {
3333
}
3434

3535
fn invoke(&self, _args: &[Value], config_context: &ConfigContext) -> Result<Value, DscError> {
36-
debug!("{}", t!("functions.add.invoked"));
36+
debug!("{}", t!("functions.context.invoked"));
3737
let context = ContextInfo {
3838
os: OsInfo::new(false),
3939
security: config_context.security_context.clone(),
4040
};
41-
Ok(serde_json::to_value(context).unwrap())
41+
Ok(serde_json::to_value(context)?)
4242
}
4343
}

0 commit comments

Comments
 (0)