From cbcacb1063c9b6384867a6078a75595ae2ff6861 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 22 Mar 2021 12:40:07 +0900 Subject: Merge some imports. --- helix-core/src/lib.rs | 3 +-- helix-core/src/syntax.rs | 25 ++++++++++++++----------- helix-core/src/transaction.rs | 3 +-- 3 files changed, 16 insertions(+), 15 deletions(-) (limited to 'helix-core/src') diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index 6b991881..a8a449ca 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -51,8 +51,7 @@ pub use tendril::StrTendril as Tendril; pub use {regex, tree_sitter}; pub use position::{coords_at_pos, pos_at_coords, Position}; -pub use selection::Range; -pub use selection::Selection; +pub use selection::{Range, Selection}; pub use syntax::Syntax; pub use diagnostic::Diagnostic; diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index e75dc724..c352f8f2 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1,12 +1,13 @@ use crate::{Change, Rope, RopeSlice, Transaction}; -pub use helix_syntax::Lang; -pub use helix_syntax::{get_language, get_language_name}; - -use std::borrow::Cow; -use std::cell::RefCell; -use std::collections::HashMap; -use std::path::{Path, PathBuf}; -use std::sync::Arc; +pub use helix_syntax::{get_language, get_language_name, Lang}; + +use std::{ + borrow::Cow, + cell::RefCell, + collections::HashMap, + path::{Path, PathBuf}, + sync::Arc, +}; use once_cell::sync::{Lazy, OnceCell}; @@ -355,9 +356,11 @@ pub struct LanguageLayer { pub(crate) tree: Option, } -use crate::coords_at_pos; -use crate::transaction::{ChangeSet, Operation}; -use crate::Tendril; +use crate::{ + coords_at_pos, + transaction::{ChangeSet, Operation}, + Tendril, +}; impl LanguageLayer { // pub fn new() -> Self { diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index f25ee208..d707016b 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -1,6 +1,5 @@ use crate::{Range, Rope, Selection, State, Tendril}; -use std::borrow::Cow; -use std::convert::TryFrom; +use std::{borrow::Cow, convert::TryFrom}; /// (from, to, replacement) pub type Change = (usize, usize, Option); -- cgit v1.2.3-70-g09d2