diff --git a/crates/ra_editor/Cargo.toml b/crates/ra_editor/Cargo.toml index 91cefc8d769..7791da15625 100644 --- a/crates/ra_editor/Cargo.toml +++ b/crates/ra_editor/Cargo.toml @@ -1,4 +1,5 @@ [package] +edition = "2018" name = "ra_editor" version = "0.1.0" authors = ["Aleksey Kladov "] diff --git a/crates/ra_editor/src/code_actions.rs b/crates/ra_editor/src/code_actions.rs index 216d592ff45..7b0a48c81a3 100644 --- a/crates/ra_editor/src/code_actions.rs +++ b/crates/ra_editor/src/code_actions.rs @@ -11,7 +11,7 @@ }, }; -use {EditBuilder, Edit, find_node_at_offset}; +use crate::{EditBuilder, Edit, find_node_at_offset}; #[derive(Debug)] pub struct LocalEdit { @@ -136,7 +136,7 @@ fn non_trivia_sibling(node: SyntaxNodeRef, direction: Direction) -> Option { - let mut scope = scopes.new_scope(scope); + let scope = scopes.new_scope(scope); scopes.add_params_bindings(scope, e.param_list()); if let Some(body) = e.body() { scopes.set_scope(body.syntax(), scope); @@ -256,7 +256,7 @@ pub fn resolve_local_name<'a>(name_ref: ast::NameRef, scopes: &'a FnScopes) -> O mod tests { use super::*; use ra_syntax::File; - use {find_node_at_offset, test_utils::extract_offset}; + use crate::{find_node_at_offset, test_utils::extract_offset}; fn do_check(code: &str, expected: &[&str]) { let (off, code) = extract_offset(code); diff --git a/crates/ra_editor/src/symbols.rs b/crates/ra_editor/src/symbols.rs index e5cc5ca284f..6211ed5477c 100644 --- a/crates/ra_editor/src/symbols.rs +++ b/crates/ra_editor/src/symbols.rs @@ -6,7 +6,7 @@ walk::{walk, WalkEvent}, }, }; -use TextRange; +use crate::TextRange; #[derive(Debug, Clone)] pub struct StructureNode { diff --git a/crates/ra_editor/src/test_utils.rs b/crates/ra_editor/src/test_utils.rs index c4ea4db6c97..49eb530d50b 100644 --- a/crates/ra_editor/src/test_utils.rs +++ b/crates/ra_editor/src/test_utils.rs @@ -1,6 +1,6 @@ use ra_syntax::{File, TextUnit, TextRange}; -pub use _test_utils::*; -use LocalEdit; +pub use crate::_test_utils::*; +use crate::LocalEdit; pub fn check_action Option> ( before: &str, diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs index 1dc658f9b09..542b9e10bd9 100644 --- a/crates/ra_editor/src/typing.rs +++ b/crates/ra_editor/src/typing.rs @@ -10,7 +10,7 @@ SyntaxKind::*, }; -use {LocalEdit, EditBuilder, find_node_at_offset}; +use crate::{LocalEdit, EditBuilder, find_node_at_offset}; pub fn join_lines(file: &File, range: TextRange) -> LocalEdit { let range = if range.is_empty() { @@ -244,7 +244,7 @@ fn compute_ws(left: SyntaxNodeRef, right: SyntaxNodeRef) -> &'static str { #[cfg(test)] mod tests { use super::*; - use test_utils::{check_action, extract_range, extract_offset, add_cursor}; + use crate::test_utils::{check_action, extract_range, extract_offset, add_cursor}; fn check_join_lines(before: &str, after: &str) { check_action(before, after, |file, offset| {