Remove unnecessary context wrappers

This commit is contained in:
世界 2023-12-16 15:40:14 +08:00
parent 89c723e3e4
commit 2e607118c3
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
6 changed files with 12 additions and 10 deletions

View file

@ -125,7 +125,7 @@ func NewRouter(
autoDetectInterface: options.AutoDetectInterface,
defaultInterface: options.DefaultInterface,
defaultMark: options.DefaultMark,
pauseManager: pause.ManagerFromContext(ctx),
pauseManager: service.FromContext[pause.Manager](ctx),
platformInterface: platformInterface,
needWIFIState: hasRule(options.Rules, isWIFIRule) || hasDNSRule(dnsOptions.Rules, isWIFIDNSRule),
needPackageManager: C.IsAndroid && platformInterface == nil && common.Any(inbounds, func(inbound option.Inbound) bool {