client.go | 10 ---------- t.go | 10 ++++++++++ diff --git a/client.go b/client.go index d2c2b4510c1e6617d0a55e99fbea274c79af028c..72da23214ad35255080db90edc6eb28b100a8d61 100644 --- a/client.go +++ b/client.go @@ -1971,16 +1971,6 @@ } return t.Info.TotalLength() - t.bytesLeft() } -func (t Torrent) NumPieces() int { - return t.numPieces() -} - -func (t Torrent) Drop() { - t.cl.mu.Lock() - t.cl.dropTorrent(t.InfoHash) - t.cl.mu.Unlock() -} - // A file-like handle to some torrent data resource. type Handle interface { io.Reader diff --git a/t.go b/t.go index c0132d773cdbadefaebbfd5f9b2d752f50f21abe..419258600a6ca1aedd800dd809c147950a877e6a 100644 --- a/t.go +++ b/t.go @@ -42,3 +42,13 @@ t.stateMu.Lock() defer t.stateMu.Unlock() return t.torrent.pieceStateRuns() } + +func (t Torrent) NumPieces() int { + return t.numPieces() +} + +func (t Torrent) Drop() { + t.cl.mu.Lock() + t.cl.dropTorrent(t.InfoHash) + t.cl.mu.Unlock() +}