Skip to content

Commit

Permalink
Add borrowing to avoid unneccassay cloning
Browse files Browse the repository at this point in the history
toelo3 committed Nov 24, 2023
1 parent 9b3191d commit 8c30b20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/common.rs
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ impl KafkaProperties {
/// Check if a list of topics is present in the read topics of datastreams
pub fn verify_list_of_topics<T: std::fmt::Display>(
&self,
topics: Vec<T>,
topics: &Vec<T>,
access: ReadWriteAccess,
) -> Result<(), Box<dyn std::error::Error>> {
let read_topics = self
@@ -360,7 +360,7 @@ impl GroupType {
}

/// Get the configured topics from the environment variable TOPICS
/// The set topics can be delimited by a comma
/// Topics can be delimited by a comma
pub fn get_configured_topics() -> Vec<String> {
let kafka_topic_string = match env::var("TOPICS") {
Ok(s) => s,
@@ -452,7 +452,7 @@ mod tests {
"stream.test.test-tenant".to_string(),
];
kafka_props()
.verify_list_of_topics(topics, ReadWriteAccess::Read)
.verify_list_of_topics(&topics, ReadWriteAccess::Read)
.unwrap()
}

0 comments on commit 8c30b20

Please sign in to comment.