1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

io: migrate the Reader API to Result instead of Option (#15229)

This commit is contained in:
Vincenzo Palazzo
2022-08-08 00:33:25 +01:00
committed by GitHub
parent 8c33a40c5a
commit b01f71d9da
13 changed files with 89 additions and 37 deletions

View File

@ -180,8 +180,8 @@ pub fn (mut s SSLConn) socket_read_into_ptr(buf_ptr &u8, len int) ?int {
return res
}
pub fn (mut s SSLConn) read(mut buffer []u8) ?int {
res := s.socket_read_into_ptr(&u8(buffer.data), buffer.len)?
pub fn (mut s SSLConn) read(mut buffer []u8) !int {
res := s.socket_read_into_ptr(&u8(buffer.data), buffer.len) or { return err }
return res
}