Skip to content

Commit 234f27a

Browse files
timfennisclaude
andcommitted
feat(stdlib): annotate all return type and add typed fib bench 🦀
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 6d83297 commit 234f27a

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn fib(n: Int) -> Int {
2+
if n <= 1 { 1 } else { fib(n - 2) + fib(n - 1) }
3+
}
4+
5+
fib(26);

‎ndc_stdlib/src/sequence.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ mod inner {
477477
}
478478

479479
/// Returns `true` if the `predicate` is true for all the elements in `seq`.
480+
#[function(return_type = bool)]
480481
pub fn all(seq: SeqValue, function: &mut VmCallable<'_>) -> anyhow::Result<Value> {
481482
for item in seq
482483
.try_into_iter()

0 commit comments

Comments
 (0)