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

all: automatic error propagation in place of "or { return(err) }"

This commit is contained in:
Maciej Obarski
2020-08-29 01:58:03 +02:00
committed by GitHub
parent 4d425b0e6d
commit 7bd2804ce9
23 changed files with 79 additions and 235 deletions

View File

@ -39,9 +39,7 @@ pub fn (mut r Readline) read_line_utf8(prompt string) ?ustring {
// Returns the string from the utf8 ustring
pub fn (mut r Readline) read_line(prompt string) ?string {
s := r.read_line_utf8(prompt) or {
return error(err)
}
s := r.read_line_utf8(prompt)?
return s.s
}
@ -49,9 +47,7 @@ pub fn (mut r Readline) read_line(prompt string) ?string {
// Returns utf8 based ustring
pub fn read_line_utf8(prompt string) ?ustring {
mut r := Readline{}
s := r.read_line_utf8(prompt) or {
return error(err)
}
s := r.read_line_utf8(prompt)?
return s
}
@ -59,8 +55,6 @@ pub fn read_line_utf8(prompt string) ?ustring {
// Return string from utf8 ustring
pub fn read_line(prompt string) ?string {
mut r := Readline{}
s := r.read_line(prompt) or {
return error(err)
}
s := r.read_line(prompt)?
return s
}