mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 15:40:28 +08:00
Fix SemVersionRangeRequirementBuilder
This commit is contained in:
parent
209bc97b32
commit
dc0ba1d8ff
@ -26,7 +26,7 @@ public object SemVersionRangeRequirementBuilder {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "(${this@or}) or ($other)"
|
||||
return "{${this@or}} || {$other}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -48,7 +48,7 @@ public object SemVersionRangeRequirementBuilder {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "(${this@and}) or ($other)"
|
||||
return "{${this@and}} && {$other}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,12 @@ public object SemVersionRangeRequirementBuilder {
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@ILoveHim188moeForever
|
||||
public inline fun custom(rule: SemVersion.Requirement): SemVersion.Requirement = rule
|
||||
public fun custom(rule: (SemVersion) -> Boolean): SemVersion.Requirement = object : SemVersion.Requirement {
|
||||
override fun test(version: SemVersion): Boolean = rule(version)
|
||||
override fun toString(): String {
|
||||
return "Custom{$rule}"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 标注一个 [SemVersionRangeRequirementBuilder] DSL
|
||||
|
Loading…
Reference in New Issue
Block a user