summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2016-09-19 21:16:50 +0200
committerDominik Picheta <dominikpicheta@gmail.com>2016-09-19 21:16:50 +0200
commit31bdf45ffe628407f8377d05bffc72fc164cc7b7 (patch)
treee1c0ac98f02f48d4a26a49de4fc75671ae881771
parent519aa16b67760cdaa3c0eb51c75480111d1f07c4 (diff)
downloadNim-31bdf45ffe628407f8377d05bffc72fc164cc7b7.tar.gz
Reverted removal of HttpCode.`$`.
-rw-r--r--lib/pure/httpcore.nim4
-rw-r--r--web/news/version_0_15_released.rst3
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/pure/httpcore.nim b/lib/pure/httpcore.nim
index 33a5357e2..7e8c41c3c 100644
--- a/lib/pure/httpcore.nim
+++ b/lib/pure/httpcore.nim
@@ -216,7 +216,7 @@ proc `==`*(protocol: tuple[orig: string, major, minor: int],
 proc contains*(methods: set[HttpMethod], x: string): bool =
   return parseEnum[HttpMethod](x) in methods
 
-proc status*(code: HttpCode): string =
+proc `$`*(code: HttpCode): string =
   ## Converts the specified ``HttpCode`` into a HTTP status.
   ##
   ## For example:
@@ -276,7 +276,7 @@ proc status*(code: HttpCode): string =
 proc `==`*(a, b: HttpCode): bool {.borrow.}
 
 proc `==`*(rawCode: string, code: HttpCode): bool =
-  return rawCode.toLower() == code.status.toLower()
+  return rawCode.toLower() == ($code).toLower()
 
 proc is2xx*(code: HttpCode): bool =
   ## Determines whether ``code`` is a 2xx HTTP status code.
diff --git a/web/news/version_0_15_released.rst b/web/news/version_0_15_released.rst
index f5217aa02..dea893ed1 100644
--- a/web/news/version_0_15_released.rst
+++ b/web/news/version_0_15_released.rst
@@ -65,9 +65,6 @@ that have tuple name:
 
 - ``AsyncHttpClient.headers`` type is now ``HttpHeaders``.
 
-- The `$` operator for ``HttpCode`` no longer exists, use the ``status``
-procedure to get the code's status message.
-
 Library Additions
 -----------------