From 04c1d951aa45486249e590e95048f2cbecc80f95 Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Sat, 28 Nov 2020 21:50:26 +0800 Subject: [PATCH] Rename `AnsiMessageBuilder.builder` to `create` --- backend/mirai-console/src/util/AnsiMessageBuilder.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/mirai-console/src/util/AnsiMessageBuilder.kt b/backend/mirai-console/src/util/AnsiMessageBuilder.kt index f33e83267..0215a5bd2 100644 --- a/backend/mirai-console/src/util/AnsiMessageBuilder.kt +++ b/backend/mirai-console/src/util/AnsiMessageBuilder.kt @@ -30,7 +30,7 @@ public open class AnsiMessageBuilder public constructor( * @param code Ansi 操作码 * * @see from - * @see builder + * @see create */ public open fun ansi(code: String): AnsiMessageBuilder = append(code) @@ -142,7 +142,7 @@ public open class AnsiMessageBuilder public constructor( */ @JvmStatic @JvmOverloads - public fun builder( + public fun create( capacity: Int = 16, noAnsi: Boolean = false ): AnsiMessageBuilder = from(StringBuilder(capacity), noAnsi) @@ -195,7 +195,7 @@ public fun AnsiMessageBuilder(capacity: Int = 16): AnsiMessageBuilder = AnsiMess public inline fun buildAnsiMessage( capacity: Int = 16, action: AnsiMessageBuilder.() -> Unit -): String = AnsiMessageBuilder.builder(capacity, false).apply(action).toString() +): String = AnsiMessageBuilder.create(capacity, false).apply(action).toString() // 不在 top-level 使用者会得到 Internal error: Couldn't inline sendAnsiMessage @@ -209,7 +209,7 @@ public suspend inline fun CommandSender.sendAnsiMessage( builder: AnsiMessageBuilder.() -> Unit ) { sendMessage( - AnsiMessageBuilder.builder(capacity, noAnsi = !AnsiMessageBuilder.isAnsiSupported(this)) + AnsiMessageBuilder.create(capacity, noAnsi = !AnsiMessageBuilder.isAnsiSupported(this)) .apply(builder) .toString() )