def begin.refund
import bend-kit-gateway@0.3.0.0/gateway.bend as Gatewayimport Base
import bend-kit-resources@0.1.0.0/resources.bend as Res
import bend-kit-cache@0.3.0.0/cache.bend as C
75# The joined grant names another pool: give the new unit back and refuse.
76def begin.refund(r: Res.Release, held: Res.Grant, cache: C.Cache<String>) -> Begin:
77 match r:
78 case Res.Released{pool}:
79 Busy{Gate{pool, held, cache}}
80 case Res.Kept{pool, one}:
81 Busy{Gate{pool, held, cache}}