Drop string methods various some types (again)

They were only for debugging and are prone to falling out of sync.
This commit is contained in:
Christian Rocha 2021-03-02 13:10:53 -05:00
parent dedf7967b0
commit 4a94b87f49

View file

@ -64,14 +64,6 @@ const (
stashStateShowingError
)
func (s stashViewState) String() string {
return map[stashViewState]string{
stashStateReady: "ready",
stashStateLoadingDocument: "loading document",
stashStateShowingError: "showing error",
}[s]
}
// The types of documents we are currently showing to the user.
type sectionKey int
@ -82,15 +74,6 @@ const (
filterSection
)
func (s sectionKey) String() string {
return map[sectionKey]string{
localSection: "local",
stashedSection: "stashed",
newsSection: "news",
filterSection: "filtered",
}[s]
}
// section contains definitions and state information for displaying a tab and
// its contents in the file listing view.
type section struct {
@ -133,14 +116,6 @@ const (
filterApplied // a filter is applied and user is not editing filter
)
func (f filterState) String() string {
return map[filterState]string{
unfiltered: "unfiltered",
filtering: "filtering",
filterApplied: "filter applied",
}[f]
}
// selectionState is the state of the currently selected document.
type selectionState int
@ -150,14 +125,6 @@ const (
selectionPromptingDelete
)
func (s selectionState) String() string {
return map[selectionState]string{
selectionIdle: "idle",
selectionSettingNote: "setting note",
selectionPromptingDelete: "prompting for deletion",
}[s]
}
// statusMessageType adds some context to the status message being sent.
type statusMessageType int
@ -168,14 +135,6 @@ const (
errorStatusMessage
)
func (s statusMessageType) String() string {
return map[statusMessageType]string{
normalStatusMessage: "normal",
subtleStatusMessage: "subtle",
errorStatusMessage: "error",
}[s]
}
// statusMessage is an ephemeral note displayed in the UI.
type statusMessage struct {
status statusMessageType