mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-13 06:30:13 +08:00
Remove duplicated asOutput
and asInput
This commit is contained in:
parent
32b1decd0d
commit
82454b0d55
@ -17,7 +17,6 @@ import kotlinx.io.core.Input
|
||||
import kotlinx.io.core.buildPacket
|
||||
import kotlinx.io.core.copyTo
|
||||
import kotlinx.io.errors.IOException
|
||||
import kotlinx.io.streams.asInput
|
||||
import kotlinx.io.streams.asOutput
|
||||
import net.mamoe.mirai.utils.io.getRandomString
|
||||
import java.awt.image.BufferedImage
|
||||
@ -89,8 +88,8 @@ suspend inline fun File.suspendToExternalImage(): ExternalImage = withContext(IO
|
||||
@Throws(IOException::class)
|
||||
fun URL.toExternalImage(): ExternalImage {
|
||||
val file = createTempFile().apply { deleteOnExit() }
|
||||
file.outputStream().asOutput().use { output ->
|
||||
openStream().asInput().use { input ->
|
||||
file.outputStream().use { output ->
|
||||
openStream().use { input ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user