mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: add [unsafe] tag to more functions: tos, string_from_wide, strings.Builder: write_bytes, free (#8766)
This commit is contained in:
@@ -28,8 +28,10 @@ pub fn (mut r Request) parse_request(s string, max_headers int) int {
|
||||
0
|
||||
)
|
||||
if pret > 0 {
|
||||
r.method = tos(r.method.str, int(method_len))
|
||||
r.path = tos(r.path.str, int(path_len))
|
||||
unsafe {
|
||||
r.method = tos(r.method.str, int(method_len))
|
||||
r.path = tos(r.path.str, int(path_len))
|
||||
}
|
||||
r.num_headers = num_headers
|
||||
}
|
||||
return pret
|
||||
@@ -46,8 +48,10 @@ pub fn (mut r Request) parse_request_path(s string) int {
|
||||
&r.path, &path_len
|
||||
)
|
||||
if pret > 0 {
|
||||
r.method = tos(r.method.str, int(method_len))
|
||||
r.path = tos(r.path.str, int(path_len))
|
||||
unsafe {
|
||||
r.method = tos(r.method.str, int(method_len))
|
||||
r.path = tos(r.path.str, int(path_len))
|
||||
}
|
||||
}
|
||||
return pret
|
||||
}
|
||||
@@ -63,8 +67,10 @@ pub fn (mut r Request) parse_request_path_pipeline(s string) int {
|
||||
&r.path, &path_len
|
||||
)
|
||||
if pret > 0 {
|
||||
r.method = tos(r.method.str, int(method_len))
|
||||
r.path = tos(r.path.str, int(path_len))
|
||||
unsafe {
|
||||
r.method = tos(r.method.str, int(method_len))
|
||||
r.path = tos(r.path.str, int(path_len))
|
||||
}
|
||||
}
|
||||
return pret
|
||||
}
|
||||
|
Reference in New Issue
Block a user