diff options
author | Matthias Beyer <matthias.beyer@ifm.com> | 2022-06-21 08:04:11 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-08-06 09:47:18 +0200 |
commit | 229259a38f41fb2686031c4bc7748eea324d8ca4 (patch) | |
tree | 1a9d2339183daee06fa11e621325220d0fcd4b89 /crates/core/tedge_mapper/src/az/mapper.rs | |
parent | a9e04b8ba2bd25eb0102ba42cf8c8d05e7d24250 (diff) |
Do not necessarily pass &str anymore to fs helper fns
This patch changs the calls of the fs helper functions where the
interface of the functions was changed from taking `&str` as path
argument to `impl AsRef<Path>`.
Because of this, it is not necessary anymore that `&str` is passed, but
`Path`es can be passed or, as in most cases, the ad-hoc created
`String` objects can be passed by value instead of by reference,
resulting in less mental load on the calling side.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Diffstat (limited to 'crates/core/tedge_mapper/src/az/mapper.rs')
-rw-r--r-- | crates/core/tedge_mapper/src/az/mapper.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/core/tedge_mapper/src/az/mapper.rs b/crates/core/tedge_mapper/src/az/mapper.rs index 73ab05a9..57c2ebff 100644 --- a/crates/core/tedge_mapper/src/az/mapper.rs +++ b/crates/core/tedge_mapper/src/az/mapper.rs @@ -28,11 +28,10 @@ impl TEdgeComponent for AzureMapper { AZURE_MAPPER_NAME } - async fn init(&self, cfg_dir: &Path) -> Result<(), anyhow::Error> { + async fn init(&self, config_dir: &Path) -> Result<(), anyhow::Error> { info!("Initialize tedge mapper az"); - let config_dir = cfg_dir.display().to_string(); create_directory_with_user_group( - &format!("{config_dir}/operations/az"), + format!("{}/operations/az", config_dir.display()), "tedge", "tedge", 0o775, |