From ae52151ac52103d9359a8d255453ddb16e8d6012 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Sat, 6 Jul 2024 23:23:21 +0200 Subject: [PATCH] fix!: drop `Clone` impl for `ContainerRequest` (#680) `Image` can be cloned just fine, but `ContainerRequest` is not intended to be, and is not, a truly safe structure for cloning. It allows to override unique container properties: container name, port mappings and log consumers (soon). If necessary, you can always use a reusable constructor/method to create multiple similar `ContainerRequests`. --- testcontainers/src/core/containers/request.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcontainers/src/core/containers/request.rs b/testcontainers/src/core/containers/request.rs index 9e3c459d..8bf462bd 100644 --- a/testcontainers/src/core/containers/request.rs +++ b/testcontainers/src/core/containers/request.rs @@ -7,7 +7,7 @@ use crate::{ /// Represents a request to start a container, allowing customization of the container. #[must_use] -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct ContainerRequest { pub(crate) image: I, pub(crate) overridden_cmd: Vec,