File tree Expand file tree Collapse file tree 5 files changed +18
-15
lines changed Expand file tree Collapse file tree 5 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ fn trim_doc_node_description(description string) string {
49
49
if dn_description.len > 80 {
50
50
dn_description = dn_description[..80 ]
51
51
}
52
- if '\n ' in dn_description {
52
+ if dn_description. contains ( '\n ' ) {
53
53
dn_description = dn_description.split ('\n ' )[0 ]
54
54
}
55
55
// if \ is last character, it ends with \" which leads to a JS error
@@ -99,7 +99,7 @@ fn is_included(path string, ignore_paths []string) bool {
99
99
return true
100
100
}
101
101
for ignore_path in ignore_paths {
102
- if ignore_path ! in path {
102
+ if ! path. contains (ignore_path) {
103
103
continue
104
104
}
105
105
return false
Original file line number Diff line number Diff line change @@ -220,22 +220,22 @@ fn main() {
220
220
mut asan_compiler := false
221
221
mut msan_compiler := false
222
222
for arg in args {
223
- if '-asan-compiler' in arg {
223
+ if arg. contains ( '-asan-compiler' ) {
224
224
asan_compiler = true
225
225
}
226
- if '-msan-compiler' in arg {
226
+ if arg. contains ( '-msan-compiler' ) {
227
227
msan_compiler = true
228
228
}
229
- if '-Werror' in arg {
229
+ if arg. contains ( '-Werror' ) {
230
230
werror = true
231
231
}
232
- if '-fsanitize=memory' in arg {
232
+ if arg. contains ( '-fsanitize=memory' ) {
233
233
sanitize_memory = true
234
234
}
235
- if '-fsanitize=address' in arg {
235
+ if arg. contains ( '-fsanitize=address' ) {
236
236
sanitize_address = true
237
237
}
238
- if '-fsanitize=undefined' in arg {
238
+ if arg. contains ( '-fsanitize=undefined' ) {
239
239
sanitize_undefined = true
240
240
}
241
241
}
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ fn supports_truecolor() bool {
196
196
buf[len] = 0
197
197
s = tos (buf, len)
198
198
}
199
- return '1:2:3' in s
199
+ return s. contains ( '1:2:3' )
200
200
}
201
201
202
202
fn termios_reset () {
@@ -296,14 +296,17 @@ fn single_char(buf string) &Event {
296
296
utf8 : event.utf8
297
297
code: KeyCode (96 | ch)
298
298
modifiers: .ctrl
299
- } }
300
- 65 ...90 { event = & Event{
299
+ }
300
+ }
301
+ 65 ...90 {
302
+ event = & Event{
301
303
typ: event.typ
302
304
ascii: event.ascii
303
305
utf8 : event.utf8
304
306
code: KeyCode (32 | ch)
305
307
modifiers: .shift
306
- } }
308
+ }
309
+ }
307
310
else {}
308
311
}
309
312
Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ pub fn (mut d Doc) generate() ? {
344
344
} else {
345
345
os.real_path (os.dir (d.base_path))
346
346
}
347
- d.is_vlib = 'vlib' ! in d.base_path
347
+ d.is_vlib = ! d.base_path. contains ( 'vlib' )
348
348
project_files := os.ls (d.base_path) or { return err }
349
349
v_files := d.prefs.should_compile_filtered_files (d.base_path, project_files)
350
350
if v_files.len == 0 {
@@ -374,7 +374,7 @@ pub fn (mut d Doc) file_asts(file_asts []ast.File) ? {
374
374
mut fname_has_set := false
375
375
d.orig_mod_name = file_asts[0 ].mod.name
376
376
for i, file_ast in file_asts {
377
- if d.filename.len > 0 && d.filename in file_ast.path && ! fname_has_set {
377
+ if d.filename.len > 0 && file_ast.path. contains (d.filename) && ! fname_has_set {
378
378
d.filename = file_ast.path
379
379
fname_has_set = true
380
380
}
Original file line number Diff line number Diff line change @@ -1767,7 +1767,7 @@ pub fn (mut f Fmt) if_expr(node ast.IfExpr) {
1767
1767
cond_len := f.out.len - cur_pos
1768
1768
is_cond_wrapped := cond_len > 0
1769
1769
&& (branch.cond is ast.IfGuardExpr || branch.cond is ast.CallExpr )
1770
- && ' \n ' in f.out.last_n (cond_len)
1770
+ && f.out.last_n (cond_len). contains ( ' \n ' )
1771
1771
if is_cond_wrapped {
1772
1772
f.writeln ('' )
1773
1773
} else {
You can’t perform that action at this time.
0 commit comments