aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
authorArnaud <[email protected]>2021-01-04 17:59:37 +0000
committerArnaud <[email protected]>2021-01-04 18:14:44 +0000
commit2f0969b873b1d28a578e1f61862f4a369ec9471f (patch)
treece4dc74a4aa84523c130f9c5a19187220d847922 /crates/hir
parenta6dc7cf36de40f6b2a5b1dfee86430848f94ce42 (diff)
Document `hir::Function::ret_type`
This adds documentation for the newly added function. It might be a bit too detailed, but I like it that way :)
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/code_model.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index e783e0aba..a8b67da20 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -743,6 +743,10 @@ impl Function {
743 db.function_data(self.id).name.clone() 743 db.function_data(self.id).name.clone()
744 } 744 }
745 745
746 /// Get this function's return type
747 ///
748 /// The returned type can be converted to a [`Type`] via its `ty`
749 /// method.
746 pub fn ret_type(self, db: &dyn HirDatabase) -> RetType { 750 pub fn ret_type(self, db: &dyn HirDatabase) -> RetType {
747 let resolver = self.id.resolver(db.upcast()); 751 let resolver = self.id.resolver(db.upcast());
748 let ret_type = &db.function_data(self.id).ret_type; 752 let ret_type = &db.function_data(self.id).ret_type;