Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Jun 2, 2022
1 parent da81ee1 commit a251538
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
14 changes: 5 additions & 9 deletions src/sinks/redis/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,11 @@ pub fn producer_loop(
for event in input.iter() {
utils.track_sink_progress(&event);
let payload = RedisRecord::from(event);
let stream: String;
match stream_strategy {
StreamStrategy::ByEventType => {
stream = payload.event.data.clone().to_string().to_lowercase();
}
_ => {
stream = redis_stream.clone();
}
}

let stream = match stream_strategy {
StreamStrategy::ByEventType => payload.event.data.clone().to_string().to_lowercase(),
_ => redis_stream.clone(),
};

log::debug!(
"Stream: {:?}, Key: {:?}, Event: {:?}",
Expand Down
7 changes: 6 additions & 1 deletion src/sinks/redis/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ impl SinkProvider for WithUtils<Config> {
_ => StreamStrategy::None,
};

let redis_stream = self.inner.stream_name.clone().unwrap_or("oura".to_string());
let redis_stream = self
.inner
.stream_name
.clone()
.unwrap_or(|| "oura".to_string());

let utils = self.utils.clone();
let handle = std::thread::spawn(move || {
producer_loop(input, utils, &mut connection, stream_strategy, redis_stream)
Expand Down

0 comments on commit a251538

Please sign in to comment.