aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-15 15:45:01 +0000
committerAleksey Kladov <[email protected]>2019-01-15 15:45:01 +0000
commit9dd4099d9388b5f61e99f923dd6c523f76ad43ff (patch)
treec4f4a4b83eb7d5ac094b31d46979eaa513e81518 /crates/ra_hir/src
parent9446be29992fe14ec529874622311c3ae7a49b0e (diff)
remove Cancelable from static&const API
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model_api.rs19
1 files changed, 8 insertions, 11 deletions
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 {
333 Const { def_id } 333 Const { def_id }
334 } 334 }
335 335
336 pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc<ast::ConstDef>)> { 336 pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc<ast::ConstDef>) {
337 Ok(def_id_to_ast(db, self.def_id)) 337 def_id_to_ast(db, self.def_id)
338 } 338 }
339} 339}
340 340
@@ -348,11 +348,8 @@ impl Static {
348 Static { def_id } 348 Static { def_id }
349 } 349 }
350 350
351 pub fn source( 351 pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc<ast::StaticDef>) {
352 &self, 352 def_id_to_ast(db, self.def_id)
353 db: &impl HirDatabase,
354 ) -> Cancelable<(HirFileId, TreeArc<ast::StaticDef>)> {
355 Ok(def_id_to_ast(db, self.def_id))
356 } 353 }
357} 354}
358 355
@@ -366,8 +363,8 @@ impl Trait {
366 Trait { def_id } 363 Trait { def_id }
367 } 364 }
368 365
369 pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc<ast::TraitDef>)> { 366 pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc<ast::TraitDef>) {
370 Ok(def_id_to_ast(db, self.def_id)) 367 def_id_to_ast(db, self.def_id)
371 } 368 }
372} 369}
373 370
@@ -381,7 +378,7 @@ impl Type {
381 Type { def_id } 378 Type { def_id }
382 } 379 }
383 380
384 pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc<ast::TypeDef>)> { 381 pub fn source(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc<ast::TypeDef>) {
385 Ok(def_id_to_ast(db, self.def_id)) 382 def_id_to_ast(db, self.def_id)
386 } 383 }
387} 384}