From 1761a7d213664cd00f7616ba3447a207eeababe9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 6 Dec 2018 20:49:36 +0300 Subject: modernize some files --- crates/ra_syntax/Cargo.toml | 2 +- crates/ra_syntax/src/lib.rs | 9 +-------- crates/ra_syntax/src/parser_api.rs | 3 ++- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index 54ee72386..8ad8ed196 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml @@ -1,5 +1,5 @@ [package] -edition = "2015" +edition = "2018" name = "ra_syntax" version = "0.1.0" authors = ["Aleksey Kladov "] diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 330f68053..56c61ae5d 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -20,13 +20,6 @@ #![allow(missing_docs)] //#![warn(unreachable_pub)] // rust-lang/rust#47816 -extern crate arrayvec; -extern crate drop_bomb; -extern crate itertools; -extern crate parking_lot; -extern crate rowan; -extern crate unicode_xid; - #[cfg(test)] #[macro_use] extern crate test_utils; @@ -48,11 +41,11 @@ pub mod utils; mod validation; mod yellow; +pub use rowan::{SmolStr, TextRange, TextUnit}; pub use crate::{ ast::AstNode, lexer::{tokenize, Token}, reparsing::AtomEdit, - rowan::{SmolStr, TextRange, TextUnit}, syntax_kinds::SyntaxKind, yellow::{ Direction, OwnedRoot, RefRoot, SyntaxError, SyntaxNode, SyntaxNodeRef, TreeRoot, WalkEvent, Location, diff --git a/crates/ra_syntax/src/parser_api.rs b/crates/ra_syntax/src/parser_api.rs index 42046d36f..c37c30e34 100644 --- a/crates/ra_syntax/src/parser_api.rs +++ b/crates/ra_syntax/src/parser_api.rs @@ -1,5 +1,6 @@ +use drop_bomb::DropBomb; + use crate::{ - drop_bomb::DropBomb, parser_impl::ParserImpl, token_set::TokenSet, SyntaxKind::{self, ERROR}, -- cgit v1.2.3 From 28ddecf6c99ef23bc96b9eb7bc8ee049f1732e76 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 6 Dec 2018 21:16:37 +0300 Subject: modernize even more --- crates/ra_syntax/src/lib.rs | 4 ---- crates/ra_syntax/src/reparsing.rs | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 56c61ae5d..0e5c9baad 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -20,10 +20,6 @@ #![allow(missing_docs)] //#![warn(unreachable_pub)] // rust-lang/rust#47816 -#[cfg(test)] -#[macro_use] -extern crate test_utils; - pub mod algo; pub mod ast; mod lexer; diff --git a/crates/ra_syntax/src/reparsing.rs b/crates/ra_syntax/src/reparsing.rs index ddcb8f6f6..732fb0e4a 100644 --- a/crates/ra_syntax/src/reparsing.rs +++ b/crates/ra_syntax/src/reparsing.rs @@ -179,10 +179,10 @@ fn merge_errors( #[cfg(test)] mod tests { - use super::{ - super::{test_utils::extract_range, text_utils::replace_range, utils::dump_tree, SourceFileNode}, - reparse_block, reparse_leaf, AtomEdit, GreenNode, SyntaxError, SyntaxNodeRef, -}; + use test_utils::{extract_range, assert_eq_text}; + + use crate::{SourceFileNode, text_utils::replace_range, utils::dump_tree }; + use super::*; fn do_check(before: &str, replace_with: &str, reparser: F) where -- cgit v1.2.3