Skip to content

Commit 8790197

Browse files
authored
Use feature (#4127)
1 parent c4e648f commit 8790197

36 files changed

+70
-110
lines changed

Cargo.lock

Lines changed: 8 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rustfmt-core/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[workspace]
22
members = [
33
"rustfmt-bin",
4-
"rustfmt-config",
5-
"rustfmt-emitter",
64
"rustfmt-lib",
75
]

rustfmt-core/rustfmt-config/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

rustfmt-core/rustfmt-config/Cargo.toml

Lines changed: 0 additions & 23 deletions
This file was deleted.

rustfmt-core/rustfmt-config/tests/license-template/lt.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

rustfmt-core/rustfmt-emitter/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

rustfmt-core/rustfmt-emitter/Cargo.toml

Lines changed: 0 additions & 15 deletions
This file was deleted.

rustfmt-core/rustfmt-lib/Cargo.toml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,25 @@ license = "Apache-2.0/MIT"
88
repository = "https://github.com/rust-lang/rustfmt"
99

1010
[features]
11+
# FIXME: Refactor so that rustfmt can be built without config or emitter.
12+
default = ["config", "emitter"]
1113
generic-simd = ["bytecount/generic-simd"]
1214

15+
config = [
16+
"dirs",
17+
"rustfmt-config_proc_macro",
18+
"serde",
19+
"serde_json",
20+
"toml",
21+
]
22+
23+
emitter = [
24+
"config",
25+
"diff",
26+
"serde",
27+
"serde_json",
28+
]
29+
1330
[dependencies]
1431
annotate-snippets = { version = "0.6", features = ["ansi_term"] }
1532
anyhow = "1.0"
@@ -19,14 +36,20 @@ itertools = "0.8"
1936
lazy_static = "1.0.0"
2037
log = "0.4"
2138
regex = "1.0"
22-
rustfmt_configuration = { path = "../rustfmt-config", version = "2.0.0-rc.1" }
23-
rustfmt_emitter = { path = "../rustfmt-emitter", version = "2.0.0-rc.1" }
2439
term = "0.6"
2540
thiserror = "1.0"
2641
unicode_categories = "0.1.1"
2742
unicode-segmentation = "1.0.0"
2843
unicode-width = "0.1.5"
2944

45+
# Optional dependencies
46+
diff = { version = "0.1", optional = true}
47+
dirs = { version = "2.0", optional = true }
48+
rustfmt-config_proc_macro = { version = "0.4", path = "config_proc_macro", optional = true }
49+
serde = { version = "1.0", features = ["derive"], optional = true }
50+
serde_json = { version = "1.0", optional = true }
51+
toml = { version = "0.5", optional = true }
52+
3053
[dev-dependencies]
3154
env_logger = "0.7"
3255

0 commit comments

Comments
 (0)