internal/app: filter ops in implementation

This is cleaner and less error-prone, and should also result in negligibly less memory allocation.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-10-10 02:23:34 +09:00
parent 4246256d78
commit 22ee5ae151
9 changed files with 57 additions and 84 deletions

View File

@@ -25,6 +25,10 @@ type spX11Op struct {
}
func (s *spX11Op) toSystem(state *outcomeStateSys) error {
if state.config.Enablements.Unwrap()&hst.EX11 == 0 {
return errNotEnabled
}
if d, ok := state.k.lookupEnv("DISPLAY"); !ok {
return newWithMessage("DISPLAY is not set")
} else {