mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
make more use of generics
This commit is contained in:
@ -27,7 +27,7 @@ type ITree interface {
|
||||
IsCollapsed(path string) bool
|
||||
ToggleCollapsed(path string)
|
||||
Tree() INode
|
||||
CollapsedPaths() CollapsedPaths
|
||||
CollapsedPaths() *CollapsedPaths
|
||||
}
|
||||
|
||||
type IFileTree interface {
|
||||
@ -48,7 +48,7 @@ type FileTree struct {
|
||||
showTree bool
|
||||
log *logrus.Entry
|
||||
filter FileTreeDisplayFilter
|
||||
collapsedPaths CollapsedPaths
|
||||
collapsedPaths *CollapsedPaths
|
||||
}
|
||||
|
||||
func NewFileTree(getFiles func() []*models.File, log *logrus.Entry, showTree bool) *FileTree {
|
||||
@ -57,7 +57,7 @@ func NewFileTree(getFiles func() []*models.File, log *logrus.Entry, showTree boo
|
||||
log: log,
|
||||
showTree: showTree,
|
||||
filter: DisplayAll,
|
||||
collapsedPaths: CollapsedPaths{},
|
||||
collapsedPaths: NewCollapsedPaths(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ func (self *FileTree) Tree() INode {
|
||||
return self.tree
|
||||
}
|
||||
|
||||
func (self *FileTree) CollapsedPaths() CollapsedPaths {
|
||||
func (self *FileTree) CollapsedPaths() *CollapsedPaths {
|
||||
return self.collapsedPaths
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user