Skip to content

Commit 0fb51b2

Browse files
Fix PathBuf type mismatches in test_group_resource
Convert String values to PathBuf using PathBuf::from() for path and directory fields in DscResource struct initialization. Co-authored-by: adityapatwardhan <[email protected]>
1 parent e891602 commit 0fb51b2

File tree

1 file changed

+7
-6
lines changed
  • tools/test_group_resource/src

1 file changed

+7
-6
lines changed

tools/test_group_resource/src/main.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use clap::Parser;
88
use dsc_lib::dscresources::resource_manifest::{ResourceManifest, GetMethod, Kind};
99
use dsc_lib::dscresources::dscresource::{Capability, DscResource, ImplementedAs};
1010
use dsc_lib::schemas::DscRepoSchema;
11+
use std::path::PathBuf;
1112

1213
fn main() {
1314
let args = Args::parse();
@@ -20,8 +21,8 @@ fn main() {
2021
capabilities: vec![Capability::Get, Capability::Set],
2122
description: Some("This is a test resource.".to_string()),
2223
implemented_as: ImplementedAs::Custom("TestResource".to_string()),
23-
path: "test_resource1".to_string(),
24-
directory: "test_directory".to_string(),
24+
path: PathBuf::from("test_resource1"),
25+
directory: PathBuf::from("test_directory"),
2526
author: Some("Microsoft".to_string()),
2627
properties: vec!["Property1".to_string(), "Property2".to_string()],
2728
require_adapter: Some("Test/TestGroup".to_string()),
@@ -46,8 +47,8 @@ fn main() {
4647
capabilities: vec![Capability::Get, Capability::Set],
4748
description: Some("This is a test resource.".to_string()),
4849
implemented_as: ImplementedAs::Custom("TestResource".to_string()),
49-
path: "test_resource2".to_string(),
50-
directory: "test_directory".to_string(),
50+
path: PathBuf::from("test_resource2"),
51+
directory: PathBuf::from("test_directory"),
5152
author: Some("Microsoft".to_string()),
5253
properties: vec!["Property1".to_string(), "Property2".to_string()],
5354
require_adapter: Some("Test/TestGroup".to_string()),
@@ -76,8 +77,8 @@ fn main() {
7677
capabilities: vec![Capability::Get],
7778
description: Some("This is a test resource.".to_string()),
7879
implemented_as: ImplementedAs::Custom("TestResource".to_string()),
79-
path: "test_resource1".to_string(),
80-
directory: "test_directory".to_string(),
80+
path: PathBuf::from("test_resource1"),
81+
directory: PathBuf::from("test_directory"),
8182
author: Some("Microsoft".to_string()),
8283
properties: vec!["Property1".to_string(), "Property2".to_string()],
8384
require_adapter: None,

0 commit comments

Comments
 (0)