def finish
import bend-collections@1.0.0.0/src/crypto/blake/blake3/blake3.bend as Blake3import Base
import bend-collections@1.0.0.0/src/crypto/blake/blake3/types.bend as T
167# Folds the stack into the pending output of the rightmost subtree.
168def finish(s: Stack, o: T.Out) -> T.Out:
169 match s:
170 case StkNil{}: o
171 case SEmpty{r}: finish(r,o)
172 case SFull{d,r}: finish(r,parent_out(d,out_cv(o)))