Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant calls to borrow() #1393

Merged
merged 6 commits into from
Sep 5, 2023
Merged

Conversation

mrcnski
Copy link
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-silent Changes should not be mentioned in any release notes 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
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

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
Contributor Author

mrcnski commented Sep 5, 2023

bot merge

@command-bot
Copy link

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
108 of 109 checks passed
@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-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants