mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 16:45:37 +00:00
78b52ec3e1
* Add config options for combinations of lines and items * Reordering of import lines implemented. * Changed nested matches to tuple pattern matching * Added ordering of path list items to the ordering of use declarations * Move `format_imports` and `format_import` methods to `imports.rs` * Add comment to explain how `use` declarations are split off while walking through a module * Change `ImportReordering` config option to separate boolean options
35 lines
589 B
Rust
35 lines
589 B
Rust
// rustfmt-reorder_imports: true
|
|
|
|
use std::str;
|
|
use std::cmp::{d, c, b, a};
|
|
use std::cmp::{b, e, g, f};
|
|
use std::ddd::aaa;
|
|
// This comment should stay with `use std::ddd;`
|
|
use std::ddd;
|
|
use std::ddd::bbb;
|
|
|
|
mod test {
|
|
}
|
|
|
|
use aaa::bbb;
|
|
use aaa;
|
|
use aaa::*;
|
|
|
|
mod test {}
|
|
// If item names are equal, order by rename
|
|
|
|
use test::{a as bb, b};
|
|
use test::{a as aa, c};
|
|
|
|
mod test {}
|
|
// If item names are equal, order by rename - no rename comes before a rename
|
|
|
|
use test::{a as bb, b};
|
|
use test::{a, c};
|
|
|
|
mod test {}
|
|
// `self` always comes first
|
|
|
|
use test::{a as aa, c};
|
|
use test::{self as bb, b};
|