]> Sergey Matveev's repositories - btrtrc.git/blobdiff - file.go
cmd/btrtrc client
[btrtrc.git] / file.go
diff --git a/file.go b/file.go
index 3a53adaa461f2d99fcde2c643813f48130fac91e..bea4b13655d6024915434eecc66eeb0cab6524ad 100644 (file)
--- a/file.go
+++ b/file.go
@@ -1,9 +1,7 @@
 package torrent
 
 import (
-       "crypto/sha256"
        "github.com/RoaringBitmap/roaring"
-       g "github.com/anacrolix/generics"
        "github.com/anacrolix/missinggo/v2/bitmap"
 
        "github.com/anacrolix/torrent/metainfo"
@@ -18,11 +16,6 @@ type File struct {
        fi          metainfo.FileInfo
        displayPath string
        prio        piecePriority
-       piecesRoot  g.Option[[sha256.Size]byte]
-}
-
-func (f *File) String() string {
-       return f.Path()
 }
 
 func (f *File) Torrent() *Torrent {
@@ -35,12 +28,12 @@ func (f *File) Offset() int64 {
 }
 
 // The FileInfo from the metainfo.Info to which this file corresponds.
-func (f *File) FileInfo() metainfo.FileInfo {
+func (f File) FileInfo() metainfo.FileInfo {
        return f.fi
 }
 
 // The file's path components joined by '/'.
-func (f *File) Path() string {
+func (f File) Path() string {
        return f.path
 }
 
@@ -211,7 +204,3 @@ func (f *File) EndPieceIndex() int {
        }
        return pieceIndex((f.offset + f.length + int64(f.t.usualPieceSize()) - 1) / int64(f.t.usualPieceSize()))
 }
-
-func (f *File) numPieces() int {
-       return f.EndPieceIndex() - f.BeginPieceIndex()
-}