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

fmt: unwrap long single line ifs (#7608)

This commit is contained in:
Lukas Neubert
2020-12-27 14:20:30 +01:00
committed by GitHub
parent e813583bc1
commit 06fdf34214
17 changed files with 252 additions and 68 deletions

View File

@ -39,7 +39,11 @@ pub fn cp_all(src string, dst string, overwrite bool) ? {
}
// single file copy
if !is_dir(source_path) {
adjusted_path := if is_dir(dest_path) { join_path(dest_path, file_name(source_path)) } else { dest_path }
adjusted_path := if is_dir(dest_path) {
join_path(dest_path, file_name(source_path))
} else {
dest_path
}
if exists(adjusted_path) {
if overwrite {
rm(adjusted_path)