diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-03 16:59:29 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-03 16:59:29 +0900 |
| commit | a5f0aa3f3077cb7bf3cbf7ac9e707ba165aceb4a (patch) | |
| tree | f75910d2147ac7c02328d229a8cb8609d2355016 /internal/app/finalise.go | |
| parent | dd0bb0a39104a54c26015df807c1eb113331c242 (diff) | |
internal/app: declutter and merge small files
This should make internal/app easier to work with for the upcoming params to shim.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/finalise.go')
| -rw-r--r-- | internal/app/finalise.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/app/finalise.go b/internal/app/finalise.go index a33bcc91..d2459421 100644 --- a/internal/app/finalise.go +++ b/internal/app/finalise.go @@ -26,6 +26,17 @@ import ( "hakurei.app/system/wayland" ) +func newInt(v int) *stringPair[int] { return &stringPair[int]{v, strconv.Itoa(v)} } + +// stringPair stores a value and its string representation. +type stringPair[T comparable] struct { + v T + s string +} + +func (s *stringPair[T]) unwrap() T { return s.v } +func (s *stringPair[T]) String() string { return s.s } + func newWithMessage(msg string) error { return newWithMessageError(msg, os.ErrInvalid) } func newWithMessageError(msg string, err error) error { return &hst.AppError{Step: "finalise", Err: err, Msg: msg} |
