File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -571,9 +571,9 @@ pub fn get_raw_line() string {
571
571
}
572
572
} $else {
573
573
max := usize (0 )
574
- buf := & char (0 )
574
+ buf := unsafe { & u8 (0 ) }
575
575
nr_chars := unsafe { C.getline (voidptr (& buf), & max, C.stdin) }
576
- str := unsafe { tos (& u8 ( buf) , if nr_chars < 0 { 0 } else { nr_chars }) }
576
+ str := unsafe { tos (buf, if nr_chars < 0 { 0 } else { nr_chars }) }
577
577
ret := str.clone ()
578
578
$if ! autofree {
579
579
unsafe {
@@ -616,7 +616,7 @@ pub fn get_raw_stdin() []u8 {
616
616
}
617
617
} $else {
618
618
max := usize (0 )
619
- buf := & char (0 )
619
+ buf := unsafe { & u8 (0 ) }
620
620
nr_chars := unsafe { C.getline (voidptr (& buf), & max, C.stdin) }
621
621
return array{
622
622
element_size: 1
Original file line number Diff line number Diff line change @@ -1034,14 +1034,14 @@ pub fn (mut t Transformer) if_expr(mut node ast.IfExpr) ast.Expr {
1034
1034
match expr {
1035
1035
ast.IfExpr {
1036
1036
if expr.branches.len == 1 {
1037
- branch.stmts.pop ( )
1037
+ branch.stmts.delete (branch.stmts.len - 1 )
1038
1038
branch.stmts << expr.branches[0 ].stmts
1039
1039
break
1040
1040
}
1041
1041
}
1042
1042
ast.MatchExpr {
1043
1043
if expr.branches.len == 1 {
1044
- branch.stmts.pop ( )
1044
+ branch.stmts.delete (branch.stmts.len - 1 )
1045
1045
branch.stmts << expr.branches[0 ].stmts
1046
1046
break
1047
1047
}
@@ -1075,14 +1075,14 @@ pub fn (mut t Transformer) match_expr(mut node ast.MatchExpr) ast.Expr {
1075
1075
match expr {
1076
1076
ast.IfExpr {
1077
1077
if expr.branches.len == 1 {
1078
- branch.stmts.pop ( )
1078
+ branch.stmts.delete (branch.stmts.len - 1 )
1079
1079
branch.stmts << expr.branches[0 ].stmts
1080
1080
break
1081
1081
}
1082
1082
}
1083
1083
ast.MatchExpr {
1084
1084
if expr.branches.len == 1 {
1085
- branch.stmts.pop ( )
1085
+ branch.stmts.delete (branch.stmts.len - 1 )
1086
1086
branch.stmts << expr.branches[0 ].stmts
1087
1087
break
1088
1088
}
You can’t perform that action at this time.
0 commit comments