Function clippy_utils::in_constant

source ·
pub fn in_constant(cx: &LateContext<'_>, id: HirId) -> bool
Expand description

Returns true if the given NodeId is inside a constant context

Example

if in_constant(cx, expr.hir_id) {
    // Do something
}