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

Formatter removes empty line when a tuple is returned #6244

Open
Lukasz2891 opened this issue Jul 8, 2024 · 0 comments
Open

Formatter removes empty line when a tuple is returned #6244

Lukasz2891 opened this issue Jul 8, 2024 · 0 comments
Labels
bug Something isn't working formatter triage This issue was opened with a template and needs to be triaged by code owners.

Comments

@Lukasz2891
Copy link

Lukasz2891 commented Jul 8, 2024

Related Component

forc-fmt

Problem

Formatter removes the empty line when a tuple is returned

#[storage(read)]
fn get_prices(feed_ids: Vec<u256>, payload_bytes: Bytes) -> (Vec<u256>, u64) {
    let (aggregated_values, timestamp) = process_input(payload_bytes, config);
    
    (aggregated_values, timestamp)
}

is formatted to

#[storage(read)]
fn get_prices(feed_ids: Vec<u256>, payload_bytes: Bytes) -> (Vec<u256>, u64) {
    let (aggregated_values, timestamp) = process_input(payload_bytes, config);
    (aggregated_values, timestamp)
}

Steps

Use the code as above and run the formatter.

Possible Solution(s)

Do not remove the empty line as for non-tuple returns.

Notes

No response

Installed components

active toolchain
----------------
testnet-aarch64-apple-darwin (override) (default), path: ...
  forc : 0.61.2
    - forc-client
      - forc-deploy : 0.61.2
      - forc-run : 0.61.2
    - forc-crypto : 0.61.2
    - forc-debug : 0.61.2
    - forc-doc : 0.61.2
    - forc-explore : 0.28.1
    - forc-fmt : 0.61.2
    - forc-lsp : 0.61.2
    - forc-tx : 0.61.2
    - forc-wallet : 0.8.1
  fuel-core : 0.28.0
  fuel-core-keygen : 0.28.0

fuels versions
--------------
forc : 0.64.0
forc-wallet : 0.64.0
@Lukasz2891 Lukasz2891 added bug Something isn't working triage This issue was opened with a template and needs to be triaged by code owners. labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter triage This issue was opened with a template and needs to be triaged by code owners.
Projects
None yet
Development

No branches or pull requests

2 participants