def cleanup.result

mylsm-lsm-store@0.6.0.1 · src/transfer/RestoreIo.bend:131

import mylsm-lsm-store@0.6.0.1/src/transfer/RestoreIo.bend as RestoreIo
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as Db

131def cleanup.result(
132  path: String,
133  result: Result<&1, &1, Db.Error, Unit>
134) -> IO(Result<&1, &1, Error, Unit>):
135  match result:
136    case Fail{error}:
137      do IO<Result<&1, &1, Error, Unit>>:
138        cleanup.directory(path)
139        return Fail{Storage{error}}
140    case Done{Unit{}}:
141      do IO<Result<&1, &1, Error, Unit>>:
142        cleanup.directory(path)
143        return Done{Unit{}}

Uses (9)

Used by (2)