diff --git a/xtask/src/install.rs b/xtask/src/install.rs index ab6ed92f73..c5bb7351a4 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs @@ -1,10 +1,10 @@ -//! Installs rust-analyzer langauge server and/or editor plugin. +//! Installs rust-analyzer language server and/or editor plugin. use std::{env, path::PathBuf, str}; use anyhow::{Context, Result}; -use crate::{run, run_with_output, Cmd}; +use crate::cmd::{run, run_with_output, Cmd}; // Latest stable, feel free to send a PR if this lags behind. const REQUIRED_RUST_VERSION: u32 = 40; diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 7bfc4a2857..b762786355 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs @@ -1,9 +1,10 @@ //! FIXME: write short doc here mod cmd; -pub mod codegen; pub mod install; pub mod pre_commit; + +pub mod codegen; mod ast_src; use anyhow::Context; @@ -13,10 +14,9 @@ use std::{ process::{Command, Stdio}, }; -use crate::codegen::Mode; +use crate::{cmd::run, codegen::Mode}; pub use anyhow::Result; -pub use cmd::{run, run_with_output, Cmd}; const TOOLCHAIN: &str = "stable"; @@ -83,7 +83,7 @@ pub fn run_clippy() -> Result<()> { Ok(()) } -pub fn install_clippy() -> Result<()> { +fn install_clippy() -> Result<()> { run(&format!("rustup toolchain install {}", TOOLCHAIN), ".")?; run(&format!("rustup component add clippy --toolchain {}", TOOLCHAIN), ".") } diff --git a/xtask/src/pre_commit.rs b/xtask/src/pre_commit.rs index 7984ba9632..88e868ca68 100644 --- a/xtask/src/pre_commit.rs +++ b/xtask/src/pre_commit.rs @@ -4,7 +4,7 @@ use std::{fs, path::PathBuf}; use anyhow::{bail, Result}; -use crate::{project_root, run, run_rustfmt, run_with_output, Mode}; +use crate::{cmd::run_with_output, project_root, run, run_rustfmt, Mode}; // FIXME: if there are changed `.ts` files, also reformat TypeScript (by // shelling out to `npm fmt`).