From 49a90d4c31148a6533d9ee9a288f42b454b2f421 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 16 Oct 2020 19:46:03 +0200 Subject: Switch from not_bash to xshell --- xtask/src/codegen/gen_features.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'xtask/src/codegen') diff --git a/xtask/src/codegen/gen_features.rs b/xtask/src/codegen/gen_features.rs index b58c4a0c9..3cf15ce02 100644 --- a/xtask/src/codegen/gen_features.rs +++ b/xtask/src/codegen/gen_features.rs @@ -3,15 +3,13 @@ use std::path::{Path, PathBuf}; use quote::quote; use walkdir::WalkDir; +use xshell::{cmd, read_file}; -use crate::{ - codegen::{project_root, reformat, update, Mode, Result}, - not_bash::{fs2, run}, -}; +use crate::codegen::{project_root, reformat, update, Mode, Result}; pub fn generate_features(mode: Mode) -> Result<()> { if !Path::new("./target/rust").exists() { - run!("git clone https://github.com/rust-lang/rust ./target/rust")?; + cmd!("git clone https://github.com/rust-lang/rust ./target/rust").run()?; } let contents = generate_descriptor("./target/rust/src/doc/unstable-book/src".into())?; @@ -34,7 +32,7 @@ fn generate_descriptor(src_dir: PathBuf) -> Result { .map(|entry| { let path = entry.path(); let feature_ident = path.file_stem().unwrap().to_str().unwrap().replace("-", "_"); - let doc = fs2::read_to_string(path).unwrap(); + let doc = read_file(path).unwrap(); quote! { LintCompletion { label: #feature_ident, description: #doc } } }); -- cgit v1.2.3