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

vfmt: simplify reading source lines

This commit is contained in:
Alexey 2020-02-13 01:19:45 +03:00 committed by GitHub
parent 8d76f7d195
commit f00ab076d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -337,11 +337,10 @@ fn file_to_mod_name_and_is_module_file(file string) (string,bool) {
}
fn read_source_lines(file string) ?[]string {
raw_fcontent := os.read_file(file) or {
source_lines := os.read_lines(file) or {
return error('can not read $file')
}
fcontent := raw_fcontent.replace('\r\n', '\n')
return fcontent.split('\n')
return source_lines
}
fn get_compile_name_of_potential_v_project(file string) string {