1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-24 20:43:33 +08:00

Apply suggestions from code review

This commit is contained in:
Him188 2024-03-03 00:00:49 +00:00 committed by GitHub
parent 5bb86cf84f
commit e6a953e05f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,9 +72,9 @@ public fun <T> MiraiFile.loadNotBlankAs(
if (!this.exists() || this.length == 0L) {
return null
}
return try{
return try {
stringFormat.decodeFromString(serializer, this.readText())
}catch(e:Throwable){//broken file
} catch (e: Throwable) { //broken file
e.printStackTrace()
null
}
@ -87,9 +87,9 @@ public fun <T> MiraiFile.loadNotBlankAs(
if (!this.exists() || this.length == 0L) {
return null
}
return try{
return try {
binaryFormat.decodeFromByteArray(serializer, this.readBytes())
}catch(e:Throwable){//broken file
} catch (e: Throwable) { //broken file
e.printStackTrace()
null
}