Move FileInfoTruncated to files package

This is where it's used, and it clarifies that it's never used over the
wire.
This commit is contained in:
Jakob Borg
2015-01-09 08:19:32 +01:00
parent 8bc7d259f4
commit 4c4143d9be
11 changed files with 227 additions and 188 deletions

View File

@@ -51,7 +51,7 @@ func genBlocks(n int) []protocol.BlockInfo {
func globalList(s *files.Set) []protocol.FileInfo {
var fs []protocol.FileInfo
s.WithGlobal(func(fi FileIntf) bool {
s.WithGlobal(func(fi files.FileIntf) bool {
f := fi.(protocol.FileInfo)
fs = append(fs, f)
return true
@@ -61,7 +61,7 @@ func globalList(s *files.Set) []protocol.FileInfo {
func haveList(s *files.Set, n protocol.DeviceID) []protocol.FileInfo {
var fs []protocol.FileInfo
s.WithHave(n, func(fi FileIntf) bool {
s.WithHave(n, func(fi files.FileIntf) bool {
f := fi.(protocol.FileInfo)
fs = append(fs, f)
return true
@@ -71,7 +71,7 @@ func haveList(s *files.Set, n protocol.DeviceID) []protocol.FileInfo {
func needList(s *files.Set, n protocol.DeviceID) []protocol.FileInfo {
var fs []protocol.FileInfo
s.WithNeed(n, func(fi FileIntf) bool {
s.WithNeed(n, func(fi files.FileIntf) bool {
f := fi.(protocol.FileInfo)
fs = append(fs, f)
return true