summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2022-12-13 08:47:01 +0100
committerGitHub <noreply@github.com>2022-12-13 08:47:01 +0100
commite4aadcf1c1b39a5fef55ce9f164b3251c44ca000 (patch)
tree4f3562a06fee3458ce83ae63a9b655c8fffc24c5 /lib/pure
parent7ae7832f761adc1b601d4d1baa07ce3cc304fb28 (diff)
downloadNim-e4aadcf1c1b39a5fef55ce9f164b3251c44ca000.tar.gz
Document that system:pop() may raise IndexDefect (#21070)
* Document system:pop() may raise IndexDefect

* Add backticks to KeyError
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/collections/sets.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim
index 09648ea65..11e324923 100644
--- a/lib/pure/collections/sets.nim
+++ b/lib/pure/collections/sets.nim
@@ -347,7 +347,7 @@ proc missingOrExcl*[A](s: var HashSet[A], key: A): bool =
 proc pop*[A](s: var HashSet[A]): A =
   ## Removes and returns an arbitrary element from the set `s`.
   ##
-  ## Raises KeyError if the set `s` is empty.
+  ## Raises `KeyError` if the set `s` is empty.
   ##
   ## See also:
   ## * `clear proc <#clear,HashSet[A]>`_
@@ -425,7 +425,7 @@ proc intersection*[A](s1, s2: HashSet[A]): HashSet[A] =
     assert c == toHashSet(["b"])
 
   result = initHashSet[A](max(min(s1.data.len, s2.data.len), 2))
-  
+
   # iterate over the elements of the smaller set
   if s1.data.len < s2.data.len:
     for item in s1:
@@ -433,7 +433,7 @@ proc intersection*[A](s1, s2: HashSet[A]): HashSet[A] =
   else:
     for item in s2:
       if item in s1: incl(result, item)
-  
+
 
 proc difference*[A](s1, s2: HashSet[A]): HashSet[A] =
   ## Returns the difference of the sets `s1` and `s2`.