From 2f0969b873b1d28a578e1f61862f4a369ec9471f Mon Sep 17 00:00:00 2001 From: Arnaud Date: Mon, 4 Jan 2021 18:59:37 +0100 Subject: 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 :) --- crates/hir/src/code_model.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/hir') 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 { db.function_data(self.id).name.clone() } + /// Get this function's return type + /// + /// The returned type can be converted to a [`Type`] via its `ty` + /// method. pub fn ret_type(self, db: &dyn HirDatabase) -> RetType { let resolver = self.id.resolver(db.upcast()); let ret_type = &db.function_data(self.id).ret_type; -- cgit v1.2.3