mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-03 11:42:28 +00:00
24 lines
360 B
Odin
24 lines
360 B
Odin
package os2
|
|
|
|
import "core:io"
|
|
|
|
to_stream :: proc(f: ^File) -> (s: io.Stream) {
|
|
if f != nil {
|
|
assert(f.impl.stream.procedure != nil)
|
|
s = f.impl.stream
|
|
}
|
|
return
|
|
}
|
|
|
|
to_writer :: to_stream
|
|
to_reader :: to_stream
|
|
|
|
|
|
@(private)
|
|
error_to_io_error :: proc(ferr: Error) -> io.Error {
|
|
if ferr == nil {
|
|
return .None
|
|
}
|
|
return ferr.(io.Error) or_else .Unknown
|
|
}
|