FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
https://docs.fuel.network/docs/sway/
Apache License 2.0
62.84k stars 5.35k forks source link

Formatter changes the code after {} are removed from use:: #6246

Open Lukasz2891 opened 1 month ago

Lukasz2891 commented 1 month ago

Related Component

forc-fmt

Problem

library;

use std::{vec::*};

pub fn aggregate_results(results: Vec<Vec<u256>>) -> Vec<u256> {
    let mut aggregated = Vec::new();

    aggregated
}

is formatted to

library;

use std::vec::*;
pub fn
 aggregate_results(results: Vec<Vec<u256>>) -> Vec<u256> {
    let mut aggregated = Vec::new();
    aggregated
}

Steps

Use the file and format it :)

Possible Solution(s)

It should be formatted to

library;

use std::vec::*;

pub fn aggregate_results(results: Vec<Vec<u256>>) -> Vec<u256> {
    let mut aggregated = Vec::new();

    aggregated
}

Notes

No response

Installed components

active toolchain
----------------
testnet-aarch64-apple-darwin (override) (default), path: /Users/lukaszkalbarczyk/Devel/redstone-oracles-monorepo/worktree-cr/packages/fuel-connector/sway/fuel-toolchain.toml
  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
JoshuaBatty commented 1 month ago

Thanks for the issue!