misc.go | 10 +++++----- diff --git a/misc.go b/misc.go index 4fbd1ff76825cd6d60ff0ad690eda76cb58fe7e7..56d1f9c9e6dee1d27584828a143b0b9e35d47071 100644 --- a/misc.go +++ b/misc.go @@ -6,7 +6,7 @@ "errors" "fmt" "time" - "github.com/anacrolix/torrent/peer_protocol" + pp "github.com/anacrolix/torrent/peer_protocol" ) const ( @@ -31,22 +31,22 @@ func (ih *InfoHash) HexString() string { return fmt.Sprintf("%x", ih[:]) } -func lastChunkSpec(pieceLength peer_protocol.Integer) (cs chunkSpec) { +func lastChunkSpec(pieceLength pp.Integer) (cs chunkSpec) { cs.Begin = (pieceLength - 1) / chunkSize * chunkSize cs.Length = pieceLength - cs.Begin return } type chunkSpec struct { - Begin, Length peer_protocol.Integer + Begin, Length pp.Integer } type request struct { - Index peer_protocol.Integer + Index pp.Integer chunkSpec } -func newRequest(index, begin, length peer_protocol.Integer) request { +func newRequest(index, begin, length pp.Integer) request { return request{index, chunkSpec{begin, length}} }