Chore: rename final

This commit is contained in:
gVisor bot 2019-02-18 21:53:57 +08:00
parent 5f26c49641
commit ef2b5d306d
3 changed files with 12 additions and 12 deletions

View File

@ -358,7 +358,7 @@ func parseRules(cfg *rawConfig) ([]C.Rule, error) {
case "MATCH": case "MATCH":
fallthrough fallthrough
case "FINAL": case "FINAL":
rules = append(rules, R.NewFinal(target)) rules = append(rules, R.NewMatch(target))
} }
} }

View File

@ -8,7 +8,7 @@ const (
GEOIP GEOIP
IPCIDR IPCIDR
SourceIPCIDR SourceIPCIDR
FINAL MATCH
) )
type RuleType int type RuleType int
@ -27,8 +27,8 @@ func (rt RuleType) String() string {
return "IPCIDR" return "IPCIDR"
case SourceIPCIDR: case SourceIPCIDR:
return "SourceIPCIDR" return "SourceIPCIDR"
case FINAL: case MATCH:
return "FINAL" return "MATCH"
default: default:
return "Unknow" return "Unknow"
} }

View File

@ -4,28 +4,28 @@ import (
C "github.com/Dreamacro/clash/constant" C "github.com/Dreamacro/clash/constant"
) )
type Final struct { type Match struct {
adapter string adapter string
} }
func (f *Final) RuleType() C.RuleType { func (f *Match) RuleType() C.RuleType {
return C.FINAL return C.MATCH
} }
func (f *Final) IsMatch(metadata *C.Metadata) bool { func (f *Match) IsMatch(metadata *C.Metadata) bool {
return true return true
} }
func (f *Final) Adapter() string { func (f *Match) Adapter() string {
return f.adapter return f.adapter
} }
func (f *Final) Payload() string { func (f *Match) Payload() string {
return "" return ""
} }
func NewFinal(adapter string) *Final { func NewMatch(adapter string) *Match {
return &Final{ return &Match{
adapter: adapter, adapter: adapter,
} }
} }