Skip to content

Commit f316907

Browse files
committed
chore: Use borrows
1 parent 035b195 commit f316907

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

rust/operator-binary/src/kafka_controller.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,7 @@ fn build_broker_rolegroup_statefulset(
10991099

11001100
// Add vector container after kafka container to keep the defaulting into kafka container
11011101
if merged_config.logging.enable_vector_agent {
1102-
match kafka
1103-
.spec
1104-
.cluster_config
1105-
.vector_aggregator_config_map_name
1106-
.to_owned()
1107-
{
1102+
match &kafka.spec.cluster_config.vector_aggregator_config_map_name {
11081103
Some(vector_aggregator_config_map_name) => {
11091104
pod_builder.add_container(
11101105
product_logging::framework::vector_container(
@@ -1118,7 +1113,7 @@ fn build_broker_rolegroup_statefulset(
11181113
.with_memory_request("128Mi")
11191114
.with_memory_limit("128Mi")
11201115
.build(),
1121-
&vector_aggregator_config_map_name,
1116+
vector_aggregator_config_map_name,
11221117
)
11231118
.context(ConfigureLoggingSnafu)?,
11241119
);

rust/operator-binary/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fn references_config_map(
237237
};
238238

239239
kafka.spec.cluster_config.zookeeper_config_map_name == config_map.name_any()
240-
|| match kafka.spec.cluster_config.authorization.opa.to_owned() {
240+
|| match &kafka.spec.cluster_config.authorization.opa {
241241
Some(opa_config) => opa_config.config_map_name == config_map.name_any(),
242242
None => false,
243243
}

0 commit comments

Comments
 (0)