chore: rewrite docstrings with generics
Some checks failed
ci/woodpecker/pr/docs Pipeline failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/docker unknown status
ci/woodpecker/pr/man unknown status
ci/woodpecker/pr/test Pipeline failed

This commit is contained in:
Jef Roosens 2023-02-08 11:11:28 +01:00
parent 91a976c634
commit b9598ca046
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
5 changed files with 8 additions and 8 deletions

View file

@ -15,7 +15,7 @@ pub fn new_response(message string) Response[string] {
}
}
// new_data_response<T> constructs a new Response<T> object with the given data
// new_data_response[T] constructs a new Response<T> object with the given data
// & an empty message field.
pub fn new_data_response[T](data T) Response[T] {
return Response[T]{
@ -24,7 +24,7 @@ pub fn new_data_response[T](data T) Response[T] {
}
}
// new_full_response<T> constructs a new Response<T> object with the given
// new_full_response[T] constructs a new Response<T> object with the given
// message & data.
pub fn new_full_response[T](message string, data T) Response[T] {
return Response[T]{

View file

@ -157,7 +157,7 @@ pub fn (mut ctx Context) body(status http.Status, content_type string, body stri
return Result{}
}
// json<T> HTTP_OK with json_s as payload with content-type `application/json`
// json[T] HTTP_OK with json_s as payload with content-type `application/json`
pub fn (mut ctx Context) json[T](status http.Status, j T) Result {
ctx.status = status
ctx.content_type = 'application/json'