Skip to content

Commit

Permalink
Fix clippy warnings (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter authored Jul 29, 2024
1 parent 387b9a1 commit 05245b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ impl SearchState {
// Invalidate when the search query changes.
if self.query != self.last_query {
invalidate = true;
self.last_query = self.query.clone();
self.last_query.clone_from(&self.query);
}

// Invalidate when the search field changes.
Expand Down Expand Up @@ -2002,7 +2002,7 @@ impl ProfApp {
}

fn multiply_scale_factor(cx: &mut Context, factor: f32) {
cx.scale_factor = (cx.scale_factor * factor).min(4.0).max(0.25);
cx.scale_factor = (cx.scale_factor * factor).clamp(0.25, 4.0);
}

fn reset_scale_factor(cx: &mut Context) {
Expand Down
2 changes: 1 addition & 1 deletion src/archive_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn create_unique_dir<P: AsRef<Path>>(path: P, force: bool) -> io::Result<PathBuf
let p = path.with_file_name(f);
let r = create_dir(&p);
if r.is_ok() {
path = p.as_path().to_owned();
path.clone_from(&p);
break;
} else if i >= retry_limit {
// tried too many times, assume this is a permanent failure
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl RandomDataSource {
}

fn entry_info(rng: &mut rand::rngs::ThreadRng) -> EntryInfo {
let kinds = vec![
let kinds = [
"CPU".to_string(),
"GPU".to_string(),
"OMP".to_string(),
Expand Down

0 comments on commit 05245b0

Please sign in to comment.