From 9dd4099d9388b5f61e99f923dd6c523f76ad43ff Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jan 2019 18:45:01 +0300 Subject: remove Cancelable from static&const API --- crates/ra_hir/src/code_model_api.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index cd61d922b..f6d1d6b23 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -333,8 +333,8 @@ impl Const { Const { def_id } } - pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc)> { - Ok(def_id_to_ast(db, self.def_id)) + pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc) { + def_id_to_ast(db, self.def_id) } } @@ -348,11 +348,8 @@ impl Static { Static { def_id } } - pub fn source( - &self, - db: &impl HirDatabase, - ) -> Cancelable<(HirFileId, TreeArc)> { - Ok(def_id_to_ast(db, self.def_id)) + pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc) { + def_id_to_ast(db, self.def_id) } } @@ -366,8 +363,8 @@ impl Trait { Trait { def_id } } - pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc)> { - Ok(def_id_to_ast(db, self.def_id)) + pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc) { + def_id_to_ast(db, self.def_id) } } @@ -381,7 +378,7 @@ impl Type { Type { def_id } } - pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc)> { - Ok(def_id_to_ast(db, self.def_id)) + pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc) { + def_id_to_ast(db, self.def_id) } } -- cgit v1.2.3