From 49324ee5669c5aad2b43a04d9d2c877b989ddc46 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 6 Dec 2018 20:42:03 +0300 Subject: modernize some code --- crates/test_utils/src/lib.rs | 7 ++----- crates/tools/src/lib.rs | 6 +----- crates/tools/src/main.rs | 12 ++++-------- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index d9fbb9b5b..e72ec9c47 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -1,12 +1,9 @@ -extern crate difference; -extern crate itertools; -extern crate text_unit; +use std::fmt; use itertools::Itertools; -use std::fmt; use text_unit::{TextRange, TextUnit}; -pub use self::difference::Changeset as __Changeset; +pub use difference::Changeset as __Changeset; pub const CURSOR_MARKER: &str = "<|>"; diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 4ff783c50..c2123db99 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -1,7 +1,3 @@ -extern crate failure; -extern crate itertools; -extern crate teraron; - use std::{ path::{Path, PathBuf}, process::{Command, Stdio}, @@ -12,7 +8,7 @@ use itertools::Itertools; pub use teraron::{Mode, Overwrite, Verify}; -pub type Result = ::std::result::Result; +pub type Result = std::result::Result; pub const GRAMMAR: &str = "crates/ra_syntax/src/grammar.ron"; pub const SYNTAX_KINDS: &str = "crates/ra_syntax/src/syntax_kinds/generated.rs.tera"; diff --git a/crates/tools/src/main.rs b/crates/tools/src/main.rs index dc623a464..7bd4a2d09 100644 --- a/crates/tools/src/main.rs +++ b/crates/tools/src/main.rs @@ -1,16 +1,12 @@ -extern crate clap; -extern crate failure; -extern crate teraron; -extern crate tools; -extern crate walkdir; - -use clap::{App, Arg, SubCommand}; -use failure::bail; use std::{ collections::HashMap, fs, path::{Path, PathBuf}, }; + +use clap::{App, Arg, SubCommand}; +use failure::bail; + use tools::{collect_tests, generate, run, run_rustfmt, Mode, Overwrite, Result, Test, Verify}; const GRAMMAR_DIR: &str = "./crates/ra_syntax/src/grammar"; -- cgit v1.2.3