Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Removes needless borrows #31489

Merged
merged 1 commit into from
May 4, 2023
Merged

Removes needless borrows #31489

merged 1 commit into from
May 4, 2023

Conversation

brooksprumo
Copy link
Contributor

Problem

While working on #31487 to upgrade our nightly Rust version, we ran into clippy lint errors like this one:

error: the borrowed expression implements the required traits
  | --> core/src/serve_repair.rs:1452:47
  | \|
  | 1452 \|         let mut pkt = Packet::from_data(None, &request).unwrap();
  | \|                                               ^^^^^^^^ help: change this to: `request`
  | \|
  | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
  | = note: `-D clippy::needless-borrow` implied by `-D warnings`

Here's the build log: https://buildkite.com/solana-labs/solana/builds/95022#0187e79f-b4ed-4e24-b5d1-926696b8d1a3

Looks like there are a few needless borrows in serve_repair.rs that can be removed.

Summary of Changes

Remove needless borrows.

@brooksprumo brooksprumo self-assigned this May 4, 2023
@brooksprumo brooksprumo marked this pull request as ready for review May 4, 2023 17:29
@brooksprumo brooksprumo requested a review from jbiseda May 4, 2023 17:29
Copy link
Contributor

@jbiseda jbiseda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brooksprumo brooksprumo added the automerge Merge this Pull Request automatically once CI passes label May 4, 2023
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #31489 (515362c) into master (22d4c6a) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #31489   +/-   ##
=======================================
  Coverage    81.4%    81.4%           
=======================================
  Files         731      731           
  Lines      208782   208782           
=======================================
+ Hits       170043   170047    +4     
+ Misses      38739    38735    -4     

@mergify mergify bot merged commit ef7470f into solana-labs:master May 4, 2023
@brooksprumo brooksprumo deleted the clippy branch May 4, 2023 18:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants