Skip to content

Commit 41f6226

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
clippy and loc fixes
1 parent 1f9cf83 commit 41f6226

3 files changed

Lines changed: 86 additions & 84 deletions

File tree

lib/dsc-lib/src/dscresources/command_resource.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub fn invoke_get(resource: &DscResource, filter: &str, target_resource: Option<
5050
None => resource
5151
};
5252
validate_security_context(&get.require_security_context, &command_resource.type_name, "get")?;
53-
let args = process_get_args(get.args.as_ref(), filter, &command_resource);
53+
let args = process_get_args(get.args.as_ref(), filter, command_resource);
5454
if !filter.is_empty() {
5555
verify_json_from_manifest(resource, filter, target_resource)?;
5656
command_input = get_command_input(get.input.as_ref(), filter)?;
@@ -116,7 +116,7 @@ pub fn invoke_set(resource: &DscResource, desired: &str, skip_test: bool, execut
116116
let (_, supports_whatif) = process_set_delete_args(
117117
set.args.as_ref(),
118118
"",
119-
&command_resource,
119+
command_resource,
120120
execution_type
121121
);
122122
supports_whatif
@@ -182,7 +182,7 @@ pub fn invoke_set(resource: &DscResource, desired: &str, skip_test: bool, execut
182182
None => resource,
183183
};
184184
validate_security_context(&get.require_security_context, &command_resource.type_name, "get")?;
185-
let args = process_get_args(get.args.as_ref(), desired, &command_resource);
185+
let args = process_get_args(get.args.as_ref(), desired, command_resource);
186186
let command_input = get_command_input(get.input.as_ref(), desired)?;
187187

188188
info!("{}", t!("dscresources.commandResource.setGetCurrent", resource = &command_resource.type_name, executable = &get.executable));
@@ -214,7 +214,7 @@ pub fn invoke_set(resource: &DscResource, desired: &str, skip_test: bool, execut
214214

215215
let mut env: Option<HashMap<String, String>> = None;
216216
let mut input_desired: Option<&str> = None;
217-
let (args, _) = process_set_delete_args(set.args.as_ref(), desired, &command_resource, execution_type);
217+
let (args, _) = process_set_delete_args(set.args.as_ref(), desired, command_resource, execution_type);
218218
match &set.input {
219219
Some(InputKind::Env) => {
220220
env = Some(json_to_hashmap(desired)?);
@@ -337,7 +337,7 @@ pub fn invoke_test(resource: &DscResource, expected: &str, target_resource: Opti
337337
None => resource,
338338
};
339339
validate_security_context(&test.require_security_context, &command_resource.type_name, "test")?;
340-
let args = process_get_args(test.args.as_ref(), expected, &command_resource);
340+
let args = process_get_args(test.args.as_ref(), expected, command_resource);
341341
let command_input = get_command_input(test.input.as_ref(), expected)?;
342342

343343
info!("{}", t!("dscresources.commandResource.invokeTestUsing", resource = &command_resource.type_name, executable = &test.executable));
@@ -489,7 +489,7 @@ pub fn invoke_delete(resource: &DscResource, filter: &str, target_resource: Opti
489489
None => resource,
490490
};
491491
validate_security_context(&delete.require_security_context, &command_resource.type_name, "delete")?;
492-
let (args, supports_whatif) = process_set_delete_args(delete.args.as_ref(), filter, &command_resource, execution_type);
492+
let (args, supports_whatif) = process_set_delete_args(delete.args.as_ref(), filter, command_resource, execution_type);
493493
if execution_type == &ExecutionKind::WhatIf && !supports_whatif {
494494
// perform a synthetic what-if by calling test and wrapping the TestResult in DeleteResultKind::SyntheticWhatIf
495495
let test_result = invoke_test(resource, filter, target_resource)?;
@@ -537,7 +537,7 @@ pub fn invoke_validate(resource: &DscResource, config: &str, target_resource: Op
537537
Some(target) => target,
538538
None => resource
539539
};
540-
let args = process_get_args(validate.args.as_ref(), config, &command_resource);
540+
let args = process_get_args(validate.args.as_ref(), config, command_resource);
541541
let command_input = get_command_input(validate.input.as_ref(), config)?;
542542

543543
info!("{}", t!("dscresources.commandResource.invokeValidateUsing", resource = &command_resource.type_name, executable = &validate.executable));
@@ -643,9 +643,9 @@ pub fn invoke_export(resource: &DscResource, input: Option<&str>, target_resourc
643643
command_input = get_command_input(export.input.as_ref(), input)?;
644644
}
645645

646-
args = process_get_args(export.args.as_ref(), input, &command_resource);
646+
args = process_get_args(export.args.as_ref(), input, command_resource);
647647
} else {
648-
args = process_get_args(export.args.as_ref(), "", &command_resource);
648+
args = process_get_args(export.args.as_ref(), "", command_resource);
649649
}
650650

651651
let (_exit_code, stdout, stderr) = invoke_command(&export.executable, args, command_input.stdin.as_deref(), Some(&resource.directory), command_input.env, manifest.exit_codes.as_ref())?;

resources/registry/locales/en-us.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ mappingNotFound = "No mapping found for registry key path: %{key_path} and value
1212
unsupportedValueType = "For value name %{value_name}, unsupported value type: %{value}"
1313
couldNotConvertDefaultValue = "Could not convert default value '%{default_value}' to registry data type: %{reg_type}"
1414
valueMappingNotFound = "No mapping found for value '%{value}' of type %{reg_type}"
15+
mappedValueNotU64 = "Mapped value for '%{value}' is not a u64"
16+
mappedValueNotString = "Mapped value for '%{value}' is not a string"
17+
unmappedByteSlice = "No mapping found for byte slice: %{hex_string}"
18+
nonStringInMultiStringDefault = "Non-string value found in default value array for REG_MULTI_SZ: %{value}"
1519

1620
[args]
1721
about = "Manage state of Windows registry"

0 commit comments

Comments
 (0)