From 2d3940d0ab862dbfaed4f4c844faaca6a38e31e9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 11 Jan 2019 19:59:06 +0300 Subject: rename TreePtr -> TreeArc This is much clearer about the semantics --- crates/ra_db/src/lib.rs | 6 +++--- crates/ra_db/src/syntax_ptr.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_db') diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 20e712afe..0c4dfc8c6 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -7,7 +7,7 @@ pub mod mock; use std::panic; -use ra_syntax::{TextUnit, TextRange, SourceFile, TreePtr}; +use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc}; pub use crate::{ cancellation::{Canceled, Cancelable}, @@ -40,13 +40,13 @@ pub trait BaseDatabase: salsa::Database + panic::RefUnwindSafe { salsa::query_group! { pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { - fn source_file(file_id: FileId) -> TreePtr { + fn source_file(file_id: FileId) -> TreeArc { type SourceFileQuery; } } } -fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreePtr { +fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc { let text = db.file_text(file_id); SourceFile::parse(&*text) } diff --git a/crates/ra_db/src/syntax_ptr.rs b/crates/ra_db/src/syntax_ptr.rs index be64d417c..5270826da 100644 --- a/crates/ra_db/src/syntax_ptr.rs +++ b/crates/ra_db/src/syntax_ptr.rs @@ -1,4 +1,4 @@ -use ra_syntax::{AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TreePtr}; +use ra_syntax::{AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TreeArc}; /// A pointer to a syntax node inside a file. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -15,7 +15,7 @@ impl LocalSyntaxPtr { } } - pub fn resolve(self, file: &SourceFile) -> TreePtr { + pub fn resolve(self, file: &SourceFile) -> TreeArc { let mut curr = file.syntax(); loop { if curr.range() == self.range && curr.kind() == self.kind { -- cgit v1.2.3