mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 01:49:12 +08:00
Wrap with withContext
This commit is contained in:
parent
c90013b23f
commit
50289924fe
@ -148,7 +148,7 @@ suspend inline fun Input.suspendToExternalImage(): ExternalImage = withContext(I
|
||||
suspend fun ByteReadChannel.toExternalImage(): ExternalImage {
|
||||
val file = createTempFile().apply { deleteOnExit() }
|
||||
file.outputStream().use {
|
||||
this.copyTo(it)
|
||||
withContext(IO) { copyTo(it) }
|
||||
it.flush()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user