Merge pull request #1738 from birkenfeld/patch-1
Handle proc-macro crates in cargo-fmt
This commit is contained in:
commit
63784cb75f
@ -148,6 +148,7 @@ enum TargetKind {
|
|||||||
Test, // test file
|
Test, // test file
|
||||||
Bench, // bench file
|
Bench, // bench file
|
||||||
CustomBuild, // build script
|
CustomBuild, // build script
|
||||||
|
ProcMacro, // a proc macro implementation
|
||||||
Other, // plugin,...
|
Other, // plugin,...
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ impl TargetKind {
|
|||||||
fn should_format(&self) -> bool {
|
fn should_format(&self) -> bool {
|
||||||
match *self {
|
match *self {
|
||||||
TargetKind::Lib | TargetKind::Bin | TargetKind::Example | TargetKind::Test |
|
TargetKind::Lib | TargetKind::Bin | TargetKind::Example | TargetKind::Test |
|
||||||
TargetKind::Bench | TargetKind::CustomBuild => true,
|
TargetKind::Bench | TargetKind::CustomBuild | TargetKind::ProcMacro => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,6 +283,7 @@ fn target_from_json(jtarget: &Value) -> Target {
|
|||||||
"example" => TargetKind::Example,
|
"example" => TargetKind::Example,
|
||||||
"bench" => TargetKind::Bench,
|
"bench" => TargetKind::Bench,
|
||||||
"custom-build" => TargetKind::CustomBuild,
|
"custom-build" => TargetKind::CustomBuild,
|
||||||
|
"proc-macro" => TargetKind::ProcMacro,
|
||||||
_ => TargetKind::Other,
|
_ => TargetKind::Other,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user