From aa07969fc21679067babbd695ce94524f1076905 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sat, 17 Jan 2026 15:12:31 +0100 Subject: [PATCH] - HashSet.len() now returns usz instead of int. #2740 --- lib/std/collections/hashset.c3 | 2 +- lib/std/collections/linked_hashset.c3 | 2 +- releasenotes.md | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/std/collections/hashset.c3 b/lib/std/collections/hashset.c3 index 9cb78ff26..4722c1100 100644 --- a/lib/std/collections/hashset.c3 +++ b/lib/std/collections/hashset.c3 @@ -32,7 +32,7 @@ struct HashSet (Printable) float load_factor; } -fn int HashSet.len(&self) @operator(len) => (int) self.count; +fn usz HashSet.len(&self) @operator(len) => self.count; <* @param [&inout] allocator : "The allocator to use" diff --git a/lib/std/collections/linked_hashset.c3 b/lib/std/collections/linked_hashset.c3 index 2325c6437..a79ef8768 100644 --- a/lib/std/collections/linked_hashset.c3 +++ b/lib/std/collections/linked_hashset.c3 @@ -34,7 +34,7 @@ struct LinkedHashSet (Printable) LinkedEntry* tail; } -fn int LinkedHashSet.len(&self) @operator(len) => (int) self.count; +fn usz LinkedHashSet.len(&self) @operator(len) => self.count; <* @param [&inout] allocator : "The allocator to use" diff --git a/releasenotes.md b/releasenotes.md index c848a9d12..90aec3386 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -89,6 +89,7 @@ - Add unit tests for HMAC 256 based on RFC 4231. #2743 - Add extra `AsciiCharset` constants and combine its related compile-time/runtime macros. #2688 - Use a `Printable` struct for ansi RGB formatting instead of explicit allocation and deprecate the old method. +- HashSet.len() now returns usz instead of int. #2740 ## 0.7.8 Change list