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

chore(rustfmt): format let-chains and let-else #9409

Merged
merged 2 commits into from
Apr 29, 2023
Merged

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Apr 24, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Cherry-pick and test rust-lang/rustfmt#5203 and rust-lang/rustfmt#5690

Use this branch rust-lang/rustfmt@master...xxchan:rustfmt:xxchan/cherry

install

git clone https://github.com/xxchan/rustfmt && cd rustfmt
git checkout xxchan/cherry
cargo build --release --bin rustfmt --bin cargo-fmt -Zunstable-options --out-dir "$(rustc --print=sysroot)/bin"

invoke

# add format_cargo_toml = true to rustfmt.toml and then
cargo +nightly-2023-01-24 fmt

Documentation

  • My PR DOES NOT contain user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

@xxchan
Copy link
Member Author

xxchan commented Apr 24, 2023

haha cargo sort failed! 😭

@xxchan xxchan changed the title chore(rustfmt): format Cargo.toml and let-chains chore(rustfmt): format let-chains Apr 24, 2023
@xxchan
Copy link
Member Author

xxchan commented Apr 24, 2023

format let-chains first, Cargo.toml next time!

@xxchan xxchan mentioned this pull request Apr 24, 2023
1 task
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #9409 (3094c2b) into main (03eceb4) will decrease coverage by 0.01%.
The diff coverage is 71.00%.

@@            Coverage Diff             @@
##             main    #9409      +/-   ##
==========================================
- Coverage   70.73%   70.73%   -0.01%     
==========================================
  Files        1233     1233              
  Lines      206503   206688     +185     
==========================================
+ Hits       146079   146198     +119     
- Misses      60424    60490      +66     
Flag Coverage Δ
rust 70.73% <71.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/connector/src/source/base.rs 64.52% <0.00%> (-0.74%) ⬇️
...onnector/src/source/google_pubsub/source/reader.rs 0.00% <ø> (ø)
src/connector/src/source/kafka/source/reader.rs 0.00% <ø> (ø)
src/expr/src/expr/expr_some_all.rs 0.00% <0.00%> (ø)
src/frontend/planner_test/src/lib.rs 75.24% <0.00%> (ø)
src/frontend/src/binder/expr/value.rs 68.96% <0.00%> (ø)
src/frontend/src/expr/table_function.rs 45.85% <0.00%> (-0.52%) ⬇️
src/frontend/src/handler/create_function.rs 0.00% <0.00%> (ø)
src/frontend/src/handler/extended_handle.rs 0.00% <0.00%> (ø)
...c/optimizer/plan_visitor/execution_mode_decider.rs 54.16% <0.00%> (ø)
... and 58 more

... and 6 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines +54 to +62
let new_left = if let Some(project) = left.as_logical_project()
&& left_input_index_on_condition
.iter()
.all(|index| project.exprs()[*index].as_input_ref().is_some())
&& join_type != JoinType::RightAnti
&& join_type != JoinType::RightSemi
&& join_type != JoinType::RightOuter
&& join_type != JoinType::FullOuter
{
Copy link
Member Author

Choose a reason for hiding this comment

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

wow 😲 Is this our largest let chain?

Comment on lines +55 to +65
if let Some(hop) = left.as_logical_hop_window()
&& left_input_index_on_condition.iter().all(|&index| {
hop.output_window_start_col_idx()
.map_or(true, |v| index != v)
&& hop.output_window_end_col_idx().map_or(true, |v| index != v)
})
&& join_type != JoinType::RightAnti
&& join_type != JoinType::RightSemi
&& join_type != JoinType::RightOuter
&& join_type != JoinType::FullOuter
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, this seems larger 🥵

Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

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

LGTM 😄

@xxchan
Copy link
Member Author

xxchan commented Apr 24, 2023

Should I wait for the holiday to merge it? 😄

@xxchan xxchan changed the title chore(rustfmt): format let-chains chore(rustfmt): format let-chains and let-else Apr 29, 2023
@xxchan xxchan enabled auto-merge April 29, 2023 08:30
@xxchan xxchan added this pull request to the merge queue Apr 29, 2023
Merged via the queue into main with commit d70dba8 Apr 29, 2023
9 checks passed
@xxchan xxchan deleted the xxchan/sharp-marlin branch April 29, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants