1
0
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:
Nick Treleaven
2021-02-15 15:15:52 +00:00
committed by GitHub
parent 4bdbb0cfa8
commit 4a0367a63c
25 changed files with 82 additions and 60 deletions

View File

@@ -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
}