Skip to content

Remove redundant calls to borrow()#1393

Merged
mrcnski merged 6 commits intomasterfrom
mrcnski/remove-redundant-borrow
Sep 5, 2023
Merged

Remove redundant calls to borrow()#1393
mrcnski merged 6 commits intomasterfrom
mrcnski/remove-redundant-borrow

Conversation

@mrcnski
Copy link
Copy Markdown
Contributor

@mrcnski mrcnski commented Sep 4, 2023

Fixes a few of these warnings I get with a recent nightly:

warning: call to `.borrow()` on a reference in this situation does nothing
   --> substrate/frame/support/src/storage/generator/map.rs:317:60
    |
317 |                 Some(ref val) => unhashed::put(final_key.as_ref(), &val.borrow()),
    |                                                                        ^^^^^^^^^ help: remove this redundant call
    |
    = note: the type `V` does not implement `Borrow`, so calling `borrow` on `&V` copies the reference, which does not do anything and can be removed

@mrcnski mrcnski added A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). R0-no-crate-publish-required The change does not require any crates to be re-published. labels Sep 4, 2023
@mrcnski mrcnski self-assigned this Sep 4, 2023
@paritytech-ci paritytech-ci requested a review from a team September 4, 2023 17:22
Copy link
Copy Markdown
Contributor

@juangirini juangirini left a comment

Choose a reason for hiding this comment

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

I wonder why it was there in the first place...

@paritytech-ci paritytech-ci requested a review from a team September 4, 2023 18:44
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
@paritytech-cicd-pr
Copy link
Copy Markdown

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable-int
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3564063

@mrcnski
Copy link
Copy Markdown
Contributor Author

mrcnski commented Sep 5, 2023

bot merge

@command-bot
Copy link
Copy Markdown

command-bot bot commented Sep 5, 2023

@mrcnski Unknown command "merge". Refer to help docs and/or source code.

@mrcnski mrcnski merged commit ec8949f into master Sep 5, 2023
@mrcnski mrcnski deleted the mrcnski/remove-redundant-borrow branch September 5, 2023 10:11
ordian added a commit that referenced this pull request Sep 6, 2023
* master: (24 commits)
  GHW for building and publishing docker images (#1391)
  pallet asset-conversion additional quote tests (#1371)
  Remove deprecated `pallet_balances`'s `set_balance_deprecated` and `transfer` dispatchables (#1226)
  Fix PRdoc check (#1419)
  Fix the wasm runtime substitute caching bug (#1416)
  Bump enumn from 0.1.11 to 0.1.12 (#1412)
  RFC 14: Improve locking mechanism for parachains (#1290)
  Add PRdoc check (#1408)
  fmt fixes (#1413)
  Enforce a decoding limit in MultiAssets (#1395)
  Remove dynamic dispatch using `Ext` (#1399)
  Remove redundant calls to `borrow()` (#1393)
  Get rid of polling in `WarpSync` (#1265)
  Bump actions/checkout from 3 to 4 (#1398)
  Bump thiserror from 1.0.47 to 1.0.48 (#1396)
  Move Relay-Specific Shared Code to One Place (#1193)
  rust docs: add simple analytics (#1377)
  Contracts: Update read_sandbox (#1390)
  Extract block announce validation from `ChainSync` (#1170)
  [ci] Remove runtime-benchmarks from tests (#1335)
  ...
ordian added a commit that referenced this pull request Sep 7, 2023
* master: (28 commits)
  Adds base benchmark for do_tick in broker pallet (#1235)
  zombienet: use another collator image for the slashing test (#1386)
  Prevent a fail prdoc check to block (#1433)
  Fix nothing scheduled on session boundary (#1403)
  GHW for building and publishing docker images (#1391)
  pallet asset-conversion additional quote tests (#1371)
  Remove deprecated `pallet_balances`'s `set_balance_deprecated` and `transfer` dispatchables (#1226)
  Fix PRdoc check (#1419)
  Fix the wasm runtime substitute caching bug (#1416)
  Bump enumn from 0.1.11 to 0.1.12 (#1412)
  RFC 14: Improve locking mechanism for parachains (#1290)
  Add PRdoc check (#1408)
  fmt fixes (#1413)
  Enforce a decoding limit in MultiAssets (#1395)
  Remove dynamic dispatch using `Ext` (#1399)
  Remove redundant calls to `borrow()` (#1393)
  Get rid of polling in `WarpSync` (#1265)
  Bump actions/checkout from 3 to 4 (#1398)
  Bump thiserror from 1.0.47 to 1.0.48 (#1396)
  Move Relay-Specific Shared Code to One Place (#1193)
  ...
Ank4n pushed a commit that referenced this pull request Sep 8, 2023
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Daanvdplas pushed a commit that referenced this pull request Sep 11, 2023
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). R0-no-crate-publish-required The change does not require any crates to be re-published.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants