Yacin Tmimi
Yacin Tmimi
## Imports with raw identifiers `reorder_imports=true` (default) **Reference in codebase:** [`impl Ord for UseSegment`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/imports.rs#L879-L961) ### V2 ```rust use websocket::r#async::futures::Stream; use websocket::client::ClientBuilder; use websocket::result::WebSocketError; ``` ### V1 ```rust use websocket::client::ClientBuilder; use...
## Force block closures for closures with a single `loop` body. **Reference in codebase:** [`closures::is_block_closure_forced_inner`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/closures.rs#L416-L427) ### V2 `loop`s are written with a block closures. ```rust fn main() { thread::spawn(|| {...
## Use correct indent when formatting complex fn type **Reference in codebase:** * [`impl Rewrite for ast::Ty (ast::TyKindParen)`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/types.rs#L763-L793) * [`impl Rewrite for ast::Ty (ast::TyKindImplTrait)`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/types.rs#L826-L840) * [`impl Rewrite for ast::FnRetTy (ast::FnRetTy::Ty)`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/items.rs#L1948-L1960)...
## Consistency between function and macro when overflowing method calls **Reference in codebase**: [`overflow::Context::try_overflow_last_item`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/overflow.rs#L469-L475) ### V2 ```rust fn main() { assert!( HAYSTACK .par_iter() .find_any(|&&x| x[0] % 1000 == 999) .is_some()...
## Consistency between function and macro when deciding to overflow items or keep them on the same line **Reference in codebase**: [`overflow::Context::rewrite_items`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/overflow.rs#L662-L670) ### V2 Overflow rules don't take macro context...
## Wrap long arrays and slice patterns **Reference in codebase**: [`impl Rewrite for Pat (PatKind::Slice)` ](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/patterns.rs#L236-L257) Added in PR: https://github.com/rust-lang/rustfmt/pull/4994 ### V2 ```rust fn main() { let [ aaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,...
## Nested tuples access without spaces **Reference in codebase**: [`impl Rewrite for ChainItem (ChainItemKind::TupleField)`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/chains.rs#L255-L263) ### V2 No spaces added ```rust fn main() { let _ = ((1,),).0.0; } ``` ###...
### Don't Change multi-line string literal indentation inside macro **Reference in codebase**: * [`utils::indent_next_line`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/utils.rs#L652-L653) * [`macros::MacroBranch::rewrite`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/macros.rs#L1287) #### V2 ```rust macro_rules! moo { () => { bar! { " " }...
### Don't indent strings within comments **Reference in codebase**: * [`utils::trim_left_preserve_layout`](https://github.com/rust-lang/rustfmt/blob/ee2bed96d60fd7e46b1fb868f6a8f27e3a8058d0/src/utils.rs#L590-L614) #### V2 ```rust pub fn main() { /* let s = String::from( " hello world ", ); */ assert_eq!(s,...
### Don't wrap string literals in Option with `wrap_str` when each line ends with line continuation (`\\`) and `format_string=false` and `Version=Two`. This version gate only seems to work in some...