From 71f3e100b65f3c9b9e78fe98c22854de5bc71d9b Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 17 May 2024 20:22:53 +0800 Subject: [PATCH] provides a `$` function for `Path` (#23617) Co-authored-by: Andreas Rumpf (cherry picked from commit 4e7c70fd7d46b2ad3bd8b0b84a9de54bea9f14fc) --- changelog.md | 5 +++++ lib/std/paths.nim | 3 +++ 2 files changed, 8 insertions(+) diff --git a/changelog.md b/changelog.md index 43a0d8ecbf..a72a224157 100644 --- a/changelog.md +++ b/changelog.md @@ -19,6 +19,11 @@ slots when enlarging a sequence. - Added `hasDefaultValue` to `std/typetraits` to check if a type has a valid default value. - Added Viewport API for the JavaScript targets in the `dom` module. +- Added `toSinglyLinkedRing` and `toDoublyLinkedRing` to `std/lists` to convert from `openArray`s. +- ORC: To be enabled via `nimOrcStats` there is a new API called `GC_orcStats` that can be used to query how many + objects the cyclic collector did free. If the number is zero that is a strong indicator that you can use `--mm:arc` + instead of `--mm:orc`. +- A `$` template is provided for `Path` in `std/paths`. [//]: # "Deprecations:" diff --git a/lib/std/paths.nim b/lib/std/paths.nim index f675e7445a..40246429e6 100644 --- a/lib/std/paths.nim +++ b/lib/std/paths.nim @@ -25,6 +25,9 @@ export ReadDirEffect, WriteDirEffect type Path* = distinct string +template `$`*(x: Path): string = + string(x) + func `==`*(x, y: Path): bool {.inline.} = ## Compares two paths. ##