Skip to main content

block_is_bare_last_result

Function block_is_bare_last_result 

Source
pub fn block_is_bare_last_result(block: &Block) -> bool
Expand description

Returns true when block is only a reference to the last-result variable or a cell-path rooted at it (e.g. $ans, $ans.last, $ans.exit_code, $ans.command), optionally wrapped in parentheses / a single-element pipeline.

Such expressions must not overwrite $ans.last when re-evaluated.