[STDLIB] Add macro return types (#2487)

* add return types to macros where applicable
* std::time::clock::now() -> clock::now()
This commit is contained in:
BWindey
2025-09-18 14:06:58 +02:00
committed by GitHub
parent fdc20dc642
commit 12eea4a98d
26 changed files with 133 additions and 132 deletions

View File

@@ -3,7 +3,7 @@ import std::collections::pair, std::io;
<*
Returns true if the array contains at least one element, else false
@param [in] array
@param [in] element
@require $kindof(array) == SLICE || $kindof(array) == ARRAY
@@ -15,13 +15,13 @@ macro bool contains(array, element)
{
if (*item == element) return true;
}
return false;
return false;
}
<*
Return the first index of element found in the array, searching from the start.
@param [in] array
@param [in] element
@require $kindof(array) == SLICE || $kindof(array) == ARRAY
@@ -29,7 +29,7 @@ macro bool contains(array, element)
@return "the first index of the element"
@return? NOT_FOUND
*>
macro index_of(array, element)
macro usz? index_of(array, element)
{
foreach (i, &e : array)
{
@@ -63,13 +63,13 @@ macro slice2d(array_ptr, x = 0, xlen = 0, y = 0, ylen = 0)
<*
Return the first index of element found in the array, searching in reverse from the end.
@param [in] array
@param [in] element
@return "the last index of the element"
@return? NOT_FOUND
*>
macro rindex_of(array, element)
macro usz? rindex_of(array, element)
{
foreach_r (i, &e : array)
{