Auto merge of #10140 - chansuke:chore/add-comment-for-enclosing-block, r=Alexendoo

chore: add simple comment for `get_enclosing_block`

I was reading the code of `clippy_utils/src/lib.rs` and thought that adding comment on `get_closing_block` would be helpful to first time visitor.

---

changelog: none
<!-- changelog_checked -->
This commit is contained in:
bors 2023-01-04 20:52:31 +00:00
commit d39dd869a5

View file

@ -1317,6 +1317,7 @@ pub fn get_parent_expr_for_hir<'tcx>(cx: &LateContext<'tcx>, hir_id: hir::HirId)
} }
} }
/// Gets the enclosing block, if any.
pub fn get_enclosing_block<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Block<'tcx>> { pub fn get_enclosing_block<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Block<'tcx>> {
let map = &cx.tcx.hir(); let map = &cx.tcx.hir();
let enclosing_node = map let enclosing_node = map