mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
fixes the typical (not a == b) bug in the documentation (#20643)
* fixes the typical (not a == b) bug; uses runnableExamples * cannot add runnableExamples
This commit is contained in:
@@ -15,7 +15,7 @@ from algorithm import binarySearch
|
||||
type
|
||||
Color* = distinct int ## A color stored as RGB, e.g. `0xff00cc`.
|
||||
|
||||
proc `==` *(a, b: Color): bool {.borrow.}
|
||||
proc `==`*(a, b: Color): bool {.borrow.}
|
||||
## Compares two colors.
|
||||
##
|
||||
## .. code-block::
|
||||
@@ -24,7 +24,7 @@ proc `==` *(a, b: Color): bool {.borrow.}
|
||||
## b = colFuchsia
|
||||
## c = Color(0x00_ff_cc)
|
||||
## assert a == b
|
||||
## assert not a == c
|
||||
## assert not (a == c)
|
||||
|
||||
template extract(a: Color, r, g, b: untyped) =
|
||||
var r = a.int shr 16 and 0xff
|
||||
|
||||
Reference in New Issue
Block a user