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

all: migrate to the new Option (p. 1) (#8924)

This commit is contained in:
spaceface
2021-02-28 20:24:29 +01:00
committed by GitHub
parent e354dcefc2
commit b9a381f101
34 changed files with 244 additions and 214 deletions

View File

@@ -26,7 +26,7 @@ pub fn temp_file(tfo TempFileOptions) ?(os.File, string) {
}
d = d.trim_right(os.path_separator)
mut rng := rand.new_default(rand.PRNGConfigStruct{})
prefix, suffix := prefix_and_suffix(tfo.pattern) or { return error(@FN + ' ' + err) }
prefix, suffix := prefix_and_suffix(tfo.pattern) or { return error(@FN + ' ' + err.msg) }
for retry := 0; retry < retries; retry++ {
path := os.join_path(d, prefix + random_number(mut rng) + suffix)
mut mode := 'rw+'
@@ -62,7 +62,7 @@ pub fn temp_dir(tdo TempFileOptions) ?string {
}
d = d.trim_right(os.path_separator)
mut rng := rand.new_default(rand.PRNGConfigStruct{})
prefix, suffix := prefix_and_suffix(tdo.pattern) or { return error(@FN + ' ' + err) }
prefix, suffix := prefix_and_suffix(tdo.pattern) or { return error(@FN + ' ' + err.msg) }
for retry := 0; retry < retries; retry++ {
path := os.join_path(d, prefix + random_number(mut rng) + suffix)
os.mkdir_all(path) or {