Skip to content

Commit

Permalink
Chore: rename final
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Feb 18, 2019
1 parent 5c8bb24 commit c0bd82d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down
6 changes: 3 additions & 3 deletions constant/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const (
GEOIP
IPCIDR
SourceIPCIDR
FINAL
MATCH
)

type RuleType int
Expand All @@ -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"
}
Expand Down
16 changes: 8 additions & 8 deletions rules/final.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit c0bd82d

Please sign in to comment.