Skip to content

Commit

Permalink
Merge pull request #590 from jeremyandrews/clippy-fixes
Browse files Browse the repository at this point in the history
fix clippy warnings
  • Loading branch information
jeremyandrews authored May 10, 2024
2 parents aa77578 + aa92af8 commit ec254ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ impl GooseAttack {
"changing startup_rate from {} to {}",
self.configuration.startup_time, startup_time
);
self.configuration.startup_time = startup_time.clone();
self.configuration.startup_time.clone_from(startup_time);
// If setting startup_time, any existing configuration for a test plan isn't valid.
self.configuration.test_plan = None;
self.reply_to_controller(
Expand Down Expand Up @@ -810,7 +810,7 @@ impl GooseAttack {
"changing run_time from {:?} to {}",
self.configuration.run_time, run_time
);
self.configuration.run_time = run_time.clone();
self.configuration.run_time.clone_from(run_time);
// If setting run_time, any existing configuration for a test plan isn't valid.
self.configuration.test_plan = None;
self.reply_to_controller(
Expand Down
6 changes: 3 additions & 3 deletions src/goose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3367,14 +3367,14 @@ mod tests {
user.set_session_data(session_data);

if let Some(session) = user.get_session_data_mut::<CustomSessionData>() {
session.data = "bar".to_owned();
"bar".clone_into(&mut session.data);
}

let session = user.get_session_data_unchecked::<CustomSessionData>();
assert_eq!(session.data, "bar".to_string());

let session = user.get_session_data_unchecked_mut::<CustomSessionData>();
session.data = "foo".to_owned();
"foo".clone_into(&mut session.data);
let session = user.get_session_data_unchecked::<CustomSessionData>();
assert_eq!(session.data, "foo".to_string());
}
Expand All @@ -3396,7 +3396,7 @@ mod tests {

user.set_session_data(session_data.clone());

session_data.data = "bar".to_owned();
"bar".clone_into(&mut session_data.data);
user.set_session_data(session_data);

let session = user.get_session_data_unchecked::<CustomSessionData>();
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,9 @@ impl GooseAttack {
goose_attack_run_state.user_channels.push(parent_sender);

// Clone the logger_tx if enabled, otherwise is None.
thread_user.logger = goose_attack_run_state.all_threads_logger_tx.clone();
thread_user
.logger
.clone_from(&goose_attack_run_state.all_threads_logger_tx);

// Copy the GooseUser-throttle receiver channel, used by all threads.
thread_user.throttle = if self.configuration.throttle_requests > 0 {
Expand Down

0 comments on commit ec254ea

Please sign in to comment.