From 327f82a05287c772d9ab688a095583f8decc8ad2 Mon Sep 17 00:00:00 2001 From: Preyas Shah Date: Mon, 22 Jul 2024 10:58:50 -0700 Subject: [PATCH] do Copy again --- martian-lab/examples/sum_sq/src/sum_squares.rs | 2 +- martian/src/stage.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/martian-lab/examples/sum_sq/src/sum_squares.rs b/martian-lab/examples/sum_sq/src/sum_squares.rs index 5a046c9404..4076ebb611 100644 --- a/martian-lab/examples/sum_sq/src/sum_squares.rs +++ b/martian-lab/examples/sum_sq/src/sum_squares.rs @@ -71,7 +71,7 @@ impl MartianStage for SumSquares { for value in args.values { let chunk_inputs = SumSquaresChunkInputs { value }; // It is optional to create a chunk with resource. If not specified, default resource will be used - stage_def.add_chunk_with_resource(chunk_inputs, chunk_resource.clone()); + stage_def.add_chunk_with_resource(chunk_inputs, chunk_resource); } // Return the stage definition Ok(stage_def) diff --git a/martian/src/stage.rs b/martian/src/stage.rs index 69c3c2dba0..49682a22be 100644 --- a/martian/src/stage.rs +++ b/martian/src/stage.rs @@ -117,7 +117,7 @@ impl MartianMakePath for T { /// /// Memory/ thread request can be negative in matrian. See /// [http://martian-lang.org/advanced-features/#resource-consumption](http://martian-lang.org/advanced-features/#resource-consumption) -#[derive(Debug, Serialize, Deserialize, Clone, Default)] +#[derive(Debug, Serialize, Deserialize, Copy, Clone, Default)] pub struct Resource { #[serde(rename = "__mem_gb", skip_serializing_if = "Option::is_none")] mem_gb: Option, @@ -637,7 +637,7 @@ pub trait MartianStage: MroMaker { fill_defaults(resource), )) } - let rover = _chunk_prelude(chunk_idx, run_directory, chunk.resource.clone())?; + let rover = _chunk_prelude(chunk_idx, run_directory, chunk.resource)?; self.main(args.clone(), chunk.inputs.clone(), rover) };