backend: move LimitReadCloser to util package

The helper is only intended for usage by backend implementations.
This commit is contained in:
Michael Eischer
2024-04-25 21:20:23 +02:00
parent dcd151147c
commit 47232bf8b0
5 changed files with 20 additions and 16 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/pkg/errors"
"github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/backend/util"
"github.com/restic/restic/internal/crypto"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/fs"
@@ -74,7 +75,7 @@ func (c *Cache) load(h backend.Handle, length int, offset int64) (io.ReadCloser,
if length <= 0 {
return f, nil
}
return backend.LimitReadCloser(f, int64(length)), nil
return util.LimitReadCloser(f, int64(length)), nil
}
// Save saves a file in the cache.