Skip to content

Commit

Permalink
Remove reference to avoid cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
knoellle committed Jun 13, 2023
1 parent b53651d commit 1c5d298
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/source_analyzer/src/cyclers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ impl Cyclers {
manifest: FrameworkManifest,
root: impl AsRef<Path>,
) -> Result<Cyclers, Error> {
let values = &manifest.cyclers;
let cyclers = values
.iter()
let cyclers = manifest
.cyclers
.into_iter()
.map(|manifest| Cycler::try_from_manifest(manifest, root.as_ref()))
.collect::<Result<_, _>>()?;
Ok(Self { cyclers })
Expand Down Expand Up @@ -94,10 +94,9 @@ pub struct Cycler {
}

impl Cycler {
fn try_from_manifest(cycler_manifest: &CyclerManifest, root: &Path) -> Result<Cycler, Error> {
fn try_from_manifest(cycler_manifest: CyclerManifest, root: &Path) -> Result<Cycler, Error> {
let instance_names = cycler_manifest
.instances
.clone()
.unwrap_or_else(|| vec![String::new()]);
let instances = instance_names
.iter()
Expand All @@ -117,7 +116,7 @@ impl Cycler {
.collect::<Result<Vec<_>, _>>()?;

Ok(Cycler {
name: cycler_manifest.name.clone(),
name: cycler_manifest.name,
kind: cycler_manifest.kind,
instances,
setup_nodes,
Expand Down

0 comments on commit 1c5d298

Please sign in to comment.