Skip to content

Commit 757e73d

Browse files
committed
fix: Fix rustfmt formatting after previous commit fix
The enums modified here were not properly formatted. The fix in the previous commit now formats them properly. -> Regardless of the presence of comments or macro attributes, if any of the enum items is multi-line, all enum items should be formatted as multi-line.
1 parent 6f204cd commit 757e73d

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

src/bin/main.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,17 @@ enum Operation {
6464
/// Print version information
6565
Version,
6666
/// Output default config to a file, or stdout if None
67-
ConfigOutputDefault { path: Option<String> },
67+
ConfigOutputDefault {
68+
path: Option<String>,
69+
},
6870
/// Output current config (as if formatting to a file) to stdout
69-
ConfigOutputCurrent { path: Option<String> },
71+
ConfigOutputCurrent {
72+
path: Option<String>,
73+
},
7074
/// No file specified, read from stdin
71-
Stdin { input: String },
75+
Stdin {
76+
input: String,
77+
},
7278
}
7379

7480
/// Rustfmt operations errors.

src/modules.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ pub struct ModuleResolutionError {
7777
pub(crate) enum ModuleResolutionErrorKind {
7878
/// Find a file that cannot be parsed.
7979
#[error("cannot parse {file}")]
80-
ParseError { file: PathBuf },
80+
ParseError {
81+
file: PathBuf,
82+
},
8183
/// File cannot be found.
8284
#[error("{file} does not exist")]
83-
NotFound { file: PathBuf },
85+
NotFound {
86+
file: PathBuf,
87+
},
8488
/// File a.rs and a/mod.rs both exist
8589
#[error("file for module found at both {default_path:?} and {secondary_path:?}")]
8690
MultipleCandidates {

tests/target/enum.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ pub enum EnumWithAttributes {
6868
SkippedItem(String,String,), // Post-comment
6969
#[another_attr]
7070
#[attr2]
71-
ItemStruct {
72-
x: usize,
73-
y: usize,
74-
}, /* Comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
71+
ItemStruct { x: usize, y: usize }, /* Comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
7572
// And another
7673
ForcedPreflight, /* AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
7774
* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */

0 commit comments

Comments
 (0)