aboutsummaryrefslogtreecommitdiff
path: root/crates/tools
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-30 10:16:22 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-30 10:16:22 +0000
commit8d1df9834c96bd464c309383afdd8edea0576ae0 (patch)
tree1836353cc58c9aeede832bb18872c37af312f377 /crates/tools
parent75acc25c5a5df2ac0a8978be2972187ee974a754 (diff)
parent0cb270e75d9501dff9ac6633354ae12d9c0f4260 (diff)
Merge #358
358: Add support for formatting entire document with rustfmt r=matklad a=aleksanb Attempting to format a document when rustfmt isn't installed will result in an error being returned to the frontend. An alternative implementation would be returning zero replacements. Part of https://github.com/rust-analyzer/rust-analyzer/issues/160. Co-authored-by: Aleksander Vognild Burkow <[email protected]>
Diffstat (limited to 'crates/tools')
-rw-r--r--crates/tools/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs
index 6f96b8120..e5b32c25c 100644
--- a/crates/tools/src/lib.rs
+++ b/crates/tools/src/lib.rs
@@ -117,7 +117,7 @@ pub fn run_rustfmt(mode: Mode) -> Result<()> {
117 Ok(()) 117 Ok(())
118} 118}
119 119
120fn install_rustfmt() -> Result<()> { 120pub fn install_rustfmt() -> Result<()> {
121 run(&format!("rustup install {}", TOOLCHAIN), ".")?; 121 run(&format!("rustup install {}", TOOLCHAIN), ".")?;
122 run( 122 run(
123 &format!("rustup component add rustfmt --toolchain {}", TOOLCHAIN), 123 &format!("rustup component add rustfmt --toolchain {}", TOOLCHAIN),