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

checks: Removes unnecessary braces #34681

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

brooksprumo
Copy link
Contributor

Problem

When upgrading nightly Rust1, there was a CI checks error2:

warning: unnecessary braces around block return value
  --> program-runtime/src/invoke_context.rs:63:21
   |
63 |                     $inner
   |                     ^^^^^^
   |
   = note: `#[warn(unused_braces)]` on by default
warning: `solana-program-runtime` (lib test) generated 1 warning

Summary of Changes

Remove the braces.

Footnotes

  1. https://github.com/solana-labs/solana/pull/34673

  2. https://buildkite.com/solana-labs/solana/builds/106341#018ce4f8-f32b-4356-92e3-b6e12960a147

```
warning: unnecessary braces around block return value
  --> program-runtime/src/invoke_context.rs:63:21
   |
63 |                     $inner
   |                     ^^^^^^
   |
   = note: `#[warn(unused_braces)]` on by default
warning: `solana-program-runtime` (lib test) generated 1 warning
```
@brooksprumo brooksprumo self-assigned this Jan 7, 2024
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (871355a) 81.8% compared to head (ab584a3) 81.8%.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34681     +/-   ##
=========================================
- Coverage    81.8%    81.8%   -0.1%     
=========================================
  Files         824      824             
  Lines      222687   222687             
=========================================
- Hits       182298   182296      -2     
- Misses      40389    40391      +2     

@brooksprumo brooksprumo marked this pull request as ready for review January 8, 2024 01:00
@brooksprumo brooksprumo requested a review from Lichtso January 8, 2024 01:00
@brooksprumo
Copy link
Contributor Author

brooksprumo commented Jan 8, 2024

@Lichtso Let me know if you'd prefer a different fix for the warning. E.g. an #[allow(unused_braces)].

I feel like this warning isn't good because it makes the resulting code look strange, so I'm very open to alternative resolutions.

Copy link
Contributor

@Lichtso Lichtso left a comment

Choose a reason for hiding this comment

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

Its a macro, so this seems acceptable as is.

@brooksprumo brooksprumo merged commit 58432a6 into solana-labs:master Jan 8, 2024
35 checks passed
@brooksprumo brooksprumo deleted the clippy/braces branch January 8, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants