mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-04 23:26:58 +08:00
Process string
properly
This commit is contained in:
parent
fbe5f14a9c
commit
7183439444
@ -261,6 +261,12 @@ fun String.generateProtoBufDataClass(): GeneratedClass {
|
||||
@Suppress("NAME_SHADOWING")
|
||||
var name = _name
|
||||
when {
|
||||
|
||||
name.startsWith("string") -> {
|
||||
name = name.substringAfter("string").takeIf { it.isNotBlank() }?.adjustName() ?: "string"
|
||||
if (defaultValue == "EMPTY_BYTE_ARRAY")
|
||||
defaultValue = "\"\""
|
||||
}
|
||||
name.startsWith("str") -> {
|
||||
name = name.substringAfter("str").takeIf { it.isNotBlank() }?.adjustName() ?: "str"
|
||||
if (defaultValue == "EMPTY_BYTE_ARRAY")
|
||||
|
Loading…
Reference in New Issue
Block a user