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":
fallthrough
case "FINAL":
rules = append(rules, R.NewFinal(target))
rules = append(rules, R.NewMatch(target))
}
}

View File

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

View File

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