mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
inline tiny proc (#15498)
This commit is contained in:
@@ -232,7 +232,7 @@ proc code*(response: Response | AsyncResponse): HttpCode
|
||||
## corresponding ``HttpCode``.
|
||||
return response.status[0 .. 2].parseInt.HttpCode
|
||||
|
||||
proc contentType*(response: Response | AsyncResponse): string =
|
||||
proc contentType*(response: Response | AsyncResponse): string {.inline.} =
|
||||
## Retrieves the specified response's content type.
|
||||
##
|
||||
## This is effectively the value of the "Content-Type" header.
|
||||
@@ -329,7 +329,7 @@ proc newProxy*(url: string, auth = ""): Proxy =
|
||||
## Constructs a new ``TProxy`` object.
|
||||
result = Proxy(url: parseUri(url), auth: auth)
|
||||
|
||||
proc newMultipartData*: MultipartData =
|
||||
proc newMultipartData*: MultipartData {.inline.} =
|
||||
## Constructs a new ``MultipartData`` object.
|
||||
MultipartData()
|
||||
|
||||
@@ -415,7 +415,7 @@ proc addFiles*(p: MultipartData, xs: openArray[tuple[name, file: string]],
|
||||
p.add(name, content, fName & ext, contentType, useStream = useStream)
|
||||
result = p
|
||||
|
||||
proc `[]=`*(p: MultipartData, name, content: string) =
|
||||
proc `[]=`*(p: MultipartData, name, content: string) {.inline.} =
|
||||
## Add a multipart entry to the multipart data ``p``. The value is added
|
||||
## without a filename and without a content type.
|
||||
##
|
||||
@@ -424,7 +424,7 @@ proc `[]=`*(p: MultipartData, name, content: string) =
|
||||
p.add(name, content)
|
||||
|
||||
proc `[]=`*(p: MultipartData, name: string,
|
||||
file: tuple[name, contentType, content: string]) =
|
||||
file: tuple[name, contentType, content: string]) {.inline.} =
|
||||
## Add a file to the multipart data ``p``, specifying filename, contentType
|
||||
## and content manually.
|
||||
##
|
||||
@@ -635,7 +635,7 @@ proc close*(client: HttpClient | AsyncHttpClient) =
|
||||
client.socket.close()
|
||||
client.connected = false
|
||||
|
||||
proc getSocket*(client: HttpClient): Socket =
|
||||
proc getSocket*(client: HttpClient): Socket {.inline.} =
|
||||
## Get network socket, useful if you want to find out more details about the connection
|
||||
##
|
||||
## this example shows info about local and remote endpoints
|
||||
@@ -647,7 +647,7 @@ proc getSocket*(client: HttpClient): Socket =
|
||||
##
|
||||
return client.socket
|
||||
|
||||
proc getSocket*(client: AsyncHttpClient): AsyncSocket =
|
||||
proc getSocket*(client: AsyncHttpClient): AsyncSocket {.inline.} =
|
||||
return client.socket
|
||||
|
||||
proc reportProgress(client: HttpClient | AsyncHttpClient,
|
||||
|
||||
Reference in New Issue
Block a user